-
Notifications
You must be signed in to change notification settings - Fork 2
/
1244.txt
55 lines (38 loc) · 820 Bytes
/
1244.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <cstdlib>
#include <iostream>
using namespace std;
long long ebob(long long a, long long b)
{
if(b==0)
return a;
else
return ebob(b,a%b);
}
long long ekob(long long a, long long b)
{
return a*b/ebob(a,b);
}
int main(int argc, char *argv[])
{
long long a,b,x,y,i,j=1,n,c[10001],say=0;
cin>>a>>b;
x=a;
y=b;
for(i=2; i<=b/2; i++)
if(b%i==0)
c[j++]=i;
c[j]=b;
for(i=1; i<=j; i++)
{
x=a*c[i];
y=b/c[i];
if(ebob(a,b)==ebob(x,y) && ekob(a,b)==ekob(x,y) && x>=a && x<=b && y>=a && y<=b)
say++;
//printf("%lld %lld\n", x,y);
}
if(ebob(a,b)==a && ekob(a,b)==b)
say++;
cout<<say<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}