Cod sursa(job #935478)
Utilizator | Data | 3 aprilie 2013 16:08:03 | |
---|---|---|---|
Problema | Mins | Scor | 15 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 kb |
#include<stdio.h>
inline int gcd ( int a, int b)
{
int r;
while(b)
{
r=a%b;
a=b;
b=r;
}
return a;
}
int main()
{
freopen("mins.in","r",stdin);
freopen("mins.out","w",stdout);
int res,x,y,c,d,i,j;
scanf("%d%d",&c,&d);
res=0;
for(x=1;x<c;x++)
for(y=1;y<d;y++)
if(gcd(x,y)==1)
res++;
printf("%d",res);
return 0;
}