Create 1425.cpp

This commit is contained in:
Kirigaya Kazuto 2016-06-13 13:01:20 +08:00 committed by GitHub
parent 6b25a191ce
commit f5c12d4a49

28
QUSTOJ/1425.cpp Normal file
View File

@ -0,0 +1,28 @@
#include<stdio.h>
#define N 600000
int main()
{
int k,m,n;
int s1,s2;
scanf("%d",&k);
while(k--)
{
scanf("%d%d",&m,&n);
s1=0;
s2=0;
for(int i=1;i<m;i++)
{
if(m%i==0)
s1+=i;
}
for(int j=1;j<n;j++)
{
if(n%j==0)
s2+=j;
}
if((s1==n)&&(s2==m))
printf("YES\n");
else printf("NO\n");
}
return 0;
}