fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. const int N = 105;
  5. int W[N], P[N];
  6.  
  7. int main() {
  8. int n, p, sum_profits = 0, sum_weights = 0;
  9. cin>>n;
  10. for(int i = 1; i <= n; i++) {
  11. cout<<1<<" "<<i<<" "<<10000<<endl;
  12. fflush(stdout);
  13. cin>>p;
  14. P[i] = p - sum_profits;
  15. sum_profits = p;
  16. int lo = 1, hi = 10000;
  17. while(lo < hi) {
  18. int mid = (lo + hi)/2;
  19. cout<<1<<" "<<i<<" "<<mid<<endl;
  20. fflush(stdout);
  21. cin>>p;
  22. if(p == sum_profits) hi = mid;
  23. else lo = mid + 1;
  24. }
  25. W[i] = lo - sum_weights;
  26. sum_weights = lo;
  27. }
  28. cout<<2<<endl;
  29. for(int i = 1; i <= n; i++) cout<<W[i]<<" ";
  30. cout<<endl;
  31. for(int i = 1; i <= n; i++) cout<<P[i]<<" ";
  32. cout<<endl;
  33. fflush(stdout);
  34. return 0;
  35. }
  36.  
Success #stdin #stdout 0s 4540KB
stdin
Standard input is empty
stdout
2