Spoj CEQU - Crucial Equation solution
Solution in C++:
///La ilaha illellahu muhammadur rasulullah
///******Bismillahir-Rahmanir-Rahim******///
///Abul Hasnat Tonmoy
///Department of CSE,23rd batch
///Islamic University,Bangladesh
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int t,a,b,c,i=0;
- cin>>t;
- while(t--)
- {
- cin>>a>>b>>c;
- i++;
- if(c%__gcd(a,b)==0)
- cout<<"Case "<<i<<": Yes"<<endl;
- else
- cout<<"Case "<<i<<": No"<<endl;
- }
- }
No comments