forked from bucketzxm/Acm-icpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path108.cpp
98 lines (82 loc) · 1.63 KB
/
108.cpp
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#include <iostream>
#include <sstream>
#include <ios>
#include <iomanip>
#include <functional>
#include <algorithm>
#include <vector>
#include <string>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <cctype>
using namespace std;
#define XINF INT_MAX
#define INF 0x3FFFFFFF
#define MP(X,Y) make_pair(X,Y)
#define PB(X) push_back(X)
#define REP(X,N) for(int X=0;X<N;X++)
#define REP2(X,L,R) for(int X=L;X<=R;X++)
#define DEP(X,R,L) for(int X=R;X>=L;X--)
#define CLR(A,X) memset(A,X,sizeof(A))
#define IT iterator
typedef long long ll;
typedef pair<int,int> PII;
typedef vector<PII> VII;
typedef vector<int> VI;
int gcd(int a,int b)
{
if(b==0)
return a;
else
return gcd(b,a%b);
}
bool isprime(int x)
{
if( x==1)return false;
for(int i=2;i<x;i++)
{
if( x%i==0)return false;
}
return true;
}
int main()
{
ios::sync_with_stdio(false);
int a,b;
int cse = 0;
while(cin>>a>>b)
{
cout<<"Case "<<++cse<<": "<<a<<", "<<b<<", ";
int wa =0,wb=0;
for(int i=1;i<a;i++)
{
if( a%i==0)
{
wa+=i;
}
}
for(int i=1;i<b;i++)
{
if(b%i==0)
{
wb+=i;
}
}
if( wa==b && a== wb)
{
cout<<"Yes"<<endl;
}
else
cout<<"No"<<endl;
}
return 0;
}