-
Notifications
You must be signed in to change notification settings - Fork 27
/
CEQU.cpp
66 lines (58 loc) · 1.15 KB
/
CEQU.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
/************
Author :- Profesor(Abhishek)
2020-09-01-13.17.13
**********/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fast ios_base::sync_with_stdio(0);cin.tie(0);
#define endl "\n"
#define fori(i,a,b) for(ll i=a;i<b;i++)
#define forr(i,a,b) for(ll i=a;i>=b;i--)
#define forit(it,x) for (auto it=(x).begin();it!=(x).end(); it++)
#define all(x) (x).begin(),(x).end()
#define allr(x) (x).rbegin(),(x).rend()
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sll set<ll>
#define vll vector<ll>
#define msl map<string,ll>
#define mll map<ll,ll>
ll i, j, k;
ll gcd(ll a, ll b)
{
if(b==0)
return a;
return gcd(b,a%b);
}
ll find_any_solution(ll a, ll b, ll c)
{
if(!(c%gcd(a,b)))
{
return 1;
}
else
return 0;
}
int main()
{
ll t, x=0;
cin >> t;
while(t--)
{
x++;
ll a, b, c;
cin >> a >> b >> c;
cout<<"Case "<<x;
if(find_any_solution(a, b, c))
{
cout <<": Yes"<<'\n';
}
else
cout <<": No"<<'\n';
}
return 0;
}