fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. const int sum = (1 << 20) + 1;
  8. const int n = 40;
  9. const int powers_cnt = 16;
  10. const int one_power = sum / powers_cnt;
  11.  
  12. vector<int> a(powers_cnt, one_power);
  13. for (int i = 1; i <= n - powers_cnt; i++)
  14. a.push_back(one_power * 2 - i);
  15.  
  16. cout << n << ' ' << sum << endl;
  17. for (int i = 0; i < int(a.size()); i++)
  18. cout << a[i] << " \n"[i + 1 == int(a.size())];
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 4528KB
stdin
Standard input is empty
stdout
40 1048577
65536 65536 65536 65536 65536 65536 65536 65536 65536 65536 65536 65536 65536 65536 65536 65536 131071 131070 131069 131068 131067 131066 131065 131064 131063 131062 131061 131060 131059 131058 131057 131056 131055 131054 131053 131052 131051 131050 131049 131048