Saleh127

UVA 10193

Sep 15th, 2020
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define test int t; cin>>t; for(int cs=1;cs<=t;cs++)
  5.  
  6. ll converttodec(string x)
  7. {
  8. ll ans=0;
  9.  
  10. for(ll i=0;i<x.size();i++)
  11. {
  12. ans=ans*2+(x[i]-'0');
  13. }
  14.  
  15. return ans;
  16. }
  17.  
  18. int main()
  19. {
  20. ios_base::sync_with_stdio(0);
  21. cin.tie(0);cout.tie(0);
  22.  
  23. test
  24. {
  25. string a,c;
  26. ll i,j,k,l,d,e;
  27.  
  28. cin>>a>>c;
  29.  
  30. d=converttodec(a);
  31. e=converttodec(c);
  32. cout<<"Pair #"<<cs<<": ";
  33.  
  34. if(__gcd(d,e)==1) cout<<"Love is not all you need!"<<endl;
  35. else cout<<"All you need is love!"<<endl;
  36.  
  37. }
  38. return 0;
  39. }
  40.  
Advertisement
Add Comment
Please, Sign In to add comment