fork download
  1. // NK
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4. #define ll long long
  5. #define ii pair<int,int>
  6. #define vi vector<int>
  7. #define vii vector<ii>
  8. #define vll vector<ll>
  9. #define eb emplace_back
  10. #define pb push_back
  11. #define pob pop_back
  12. #define psf push_front
  13. #define pof pop_front
  14. #define mkp make_pair
  15. #define all(x) x.begin(), x.end()
  16.  
  17. int main(){
  18. ll n,k; cin>>n>>k;
  19. if (n==1){
  20. if (k>0) cout<<-1;
  21. else cout<<1;
  22. return 0;
  23. }
  24. ll mini=n/2, firstpair=k-(mini-1);
  25. if (mini>k) {cout<<-1; return 0;}
  26. ll a=firstpair,b=firstpair*2;
  27. cout<<a<<' '<<b<<' ';
  28. for (ll i=1, c=2; c<n; i+=2, c+=2){
  29. if (c+1==n) break;
  30. if (i!=a and i!=b and i+1!=a and i+1!=b) cout<<i<<' '<<i+1<<' ';
  31. else c-=2;
  32. }
  33. if (n&1) cout<<1000000000;
  34. return 0;
  35. }
  36.  
Success #stdin #stdout 0s 4176KB
stdin
11 10
stdout
6 12 1 2 3 4 7 8 9 10 1000000000