Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int gcd(long long a,long long b)
- {
- if (b == 0)
- return a;
- else
- return gcd (b, a % b);
- }
- int main()
- {
- int t;
- cin>>t;
- int cnt=1;
- while(t--)
- {
- long long a,b,c;
- cin>>a>>b>>c;
- long long k=gcd(abs(a),abs(b));
- if(c%k==0)
- cout<<"Case "<<cnt++<<": "<<"Yes"<<endl;
- else
- cout<<"Case "<<cnt++<<": "<<"No"<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement