fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int t;
  6. cin >> t;
  7. while(t--){
  8.  
  9. int n, w;
  10. cin >> n >> w;
  11. cout << n - (n /w) << "\n";
  12. }
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 5288KB
stdin
5
9 3
13 4
15 14
20 1
1000 42
stdout
6
10
14
0
977