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;
  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. }
  17. for(int i=0;i<n;i++)
  18. {
  19. if((i+1)%2==1)
  20. {
  21. cout << i+1 << " ";
  22. }
  23. }
  24. cout << endl;
  25.  
  26. }
  27. else
  28. {
  29. cout << "impossible'" << endl;
  30. }
  31. return 0;
  32. }
Success #stdin #stdout 0s 5324KB
stdin
4
stdout
2 4 1 3