fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. vector<int> v;
  6. int a;
  7. cin >> a;
  8. for(int i=0; i<a; i++){
  9. int b, c;
  10. cin >> b >> c;
  11. int d=b%1000000000;
  12. cout << d << " ";
  13. if(v[d]+d>=0){
  14. cout << v[d]+d << endl;
  15. v[d]+=d;
  16. }
  17. else
  18. cout << "NIE" << endl;
  19. }
  20. return 0;
  21. }
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
Standard output is empty