fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int t;
  7. cin >> t;
  8. while(t--){
  9. int x, y;
  10. cin >> x >> y;
  11. int z = x % y;
  12. cout << z << endl;
  13. }
  14. return 0;
  15. }
Success #stdin #stdout 0s 5300KB
stdin
3 
1 2
100 200
40 15
stdout
1
100
10