fork(1) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int d, o, c,x,y;
  6.  
  7. int main()
  8. {
  9. cin>>d;
  10. for(int i=0; i<d; i++)
  11. {
  12. cin>>o>>c;
  13. if(o=1) cout<<"NIE";
  14. else
  15. {
  16. x = c/(o-1);
  17. y = c - x*(o-1);
  18. if(y>=1) cout<<"TAK";
  19. else cout<<"NIE";
  20. }
  21.  
  22.  
  23. }
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
Standard output is empty