fork(2) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int Ciastka,ile,Liczebnosc;
  6. double Ciastko_kolega,Reszta;
  7.  
  8. int main()
  9. {
  10. cin>>ile;
  11. for (int i=1; i<=ile; i++)
  12. {
  13. cin>>Ciastka;
  14. cin>>Liczebnosc;
  15.  
  16. if (Liczebnosc>1)
  17. {
  18. Ciastko_kolega=Ciastka/(Liczebnosc-1);
  19. Reszta=Ciastka-Ciastko_kolega*(Liczebnosc-1);
  20.  
  21. if (Reszta>0) cout<<"TAK"<<endl;
  22. else cout<<"NIE"<<endl;
  23. }
  24. else if((Liczebnosc>0)&&(Liczebnosc<=1)) cout<<"TAK"<<endl;
  25. else cout<<"NIE"<<endl;
  26. }
  27.  
  28. return 0;
  29. }
  30.  
Success #stdin #stdout 0s 4540KB
stdin
5
2 3
55 22
45 15
45 16
1 1
stdout
NIE
TAK
TAK
NIE
TAK