fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. long long nwd(long long a, long long b){
  5.  
  6. while(b!=0){
  7.  
  8. long long t=b;
  9. b=a%b;
  10. a=t;
  11. }
  12. return a;
  13.  
  14. }
  15.  
  16. int main(){
  17.  
  18. ios_base::sync_with_stdio(0);
  19. cin.tie(0);
  20.  
  21. long long a, b;
  22. cin >> a >> b;
  23.  
  24. if( nwd(a,b) > 1) {
  25. cout << "TAK";
  26. }else {
  27. cout << "NIE";
  28. }
  29.  
  30.  
  31. return 0;
  32. }
Success #stdin #stdout 0.01s 5284KB
stdin
14 15
stdout
NIE