fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;
  6. int v;
  7. cin >> n >> v;
  8. for (int i=1; i<n; i++)
  9. {
  10. int z;
  11. cin >> z;
  12. cout << z/v << " " << z%v << endl;
  13. }
  14. return 0;
  15. }
Success #stdin #stdout 0.01s 5300KB
stdin
7 6
24
13
6
10
17
23
40
stdout
4 0
2 1
1 0
1 4
2 5
3 5