Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. #define vi vector<int>
  6. #define ll long long
  7. #define pb push_back
  8. #define mp make_pair
  9. #define ii pair<int,int>
  10.  
  11. long long gcd(long long a, long long b) {
  12.  
  13. if (b == 0)
  14. {
  15. return a;
  16. }
  17.  
  18. return gcd(b, a%b);
  19. }
  20.  
  21. int main(){
  22. long long n,m;
  23. long long k;
  24.  
  25. cin >> n;
  26. cin >> m;
  27.  
  28. k = gcd(gcd(n,m),m/gcd(n,m));
  29. if((k > 1)&&((k!=n)&&(k!=m)))
  30. printf("Sim\n");
  31. else
  32. printf("Nao\n");
  33.  
  34. return 0;
  35. }
  36.  
  37.  
  38. /*
  39. compilar
  40. g++ arquivo.cpp -std=c++11 -o executavel
  41. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement