fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;
  6. cin >> n;
  7. vector<int> v,p;
  8. if(n%2==0)
  9. {
  10. for(int i=0;i<n;i++)
  11. {
  12. if((i+1)%2==0)
  13. {
  14. cout << i+1 << " ";
  15. }
  16. else cout << i+1 << " ";
  17. }
  18. cout << endl;
  19.  
  20.  
  21. }
  22. else
  23. {
  24. cout << "impossible'" << endl;
  25. }
  26. return 0;
  27. }
Success #stdin #stdout 0s 5316KB
stdin
4
stdout
1 2 3 4