fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define int long long int
  4. const int MOD = 1000000007;
  5.  
  6. void init_code() {
  7. #ifndef ONLINE_JUDGE
  8. freopen("input.txt", "r", stdin);
  9. freopen("output.txt", "w", stdout);
  10. #endif
  11. }
  12.  
  13. int32_t main() {
  14. //init_code();
  15. int t;
  16. cin >> t;
  17. while (t--) {
  18. int n;
  19. cin>>n;
  20. if(n<=4) {
  21. cout<<-1<<"\n";
  22. } else {
  23. for(int i=1;i<=n;i=i+2) {
  24. if(i==5) {
  25. continue;
  26. } else {
  27. cout<<i<<" ";
  28. }
  29. }
  30. cout<<5<<" "<<4<<" ";
  31. for(int i=2;i<=n;i=i+2) {
  32. if(i==4) {
  33. continue;
  34. } else {
  35. cout<<i<<" ";
  36. }
  37. }
  38. cout<<"\n";
  39. }
  40. //cout<<1<<" "<<n-2<<"\n";
  41. }
  42. return 0;
  43. }
Success #stdin #stdout 0.01s 5280KB
stdin
2
3
6
stdout
-1
1 3 5 4 2 6