fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. using namespace chrono;
  4.  
  5. template<typename Int>
  6. struct random_variable: mt19937_64 {
  7. random_variable() : mt19937_64(steady_clock::now().time_since_epoch().count()) {}
  8. Int value(Int u, Int v) { return uniform_int_distribution<Int>(u,v)(*this); } };
  9.  
  10. random_variable<int> Random; random_variable<int64_t> RandomLL;
  11.  
  12. const int sum = Random.value(2,100), x = Random.value(1,sum-1), y = sum-x, z[] = {x,y};
  13.  
  14. int main() {
  15.  
  16. int n, p; int64_t q; cin >> n >> p >> q;
  17.  
  18. cout << 1 << endl << n << endl;
  19.  
  20. for (int i = 0; i < n; ++i)
  21. cout << 100*Random.value(1,p) << ' ';
  22.  
  23. for (int i = 0; i < 2; ++i)
  24. cout << endl << z[i] << ' ' << Random.value(1,n);
  25.  
  26. cout << endl << RandomLL.value(1,q);
  27. }
  28.  
Success #stdin #stdout 0s 4188KB
stdin
10 100 1000
stdout
1
10
7400 9600 4300 1900 7500 7400 8000 8900 3400 6800 
59 3
13 3
838