fork download
  1. #include<bits/stdc++.h>
  2. #define faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  3. #define db double
  4. #define bo bool
  5. #define vo void
  6. #define ch char
  7. #define fl float
  8. #define ll long long
  9. #define ull unsigned long long
  10. #define str string
  11. #define re return
  12. #define all(x) (x).begin(),(x).end()
  13. using namespace std;
  14. int main()
  15. {
  16. faster
  17. ll t,n,i;
  18. cin>>t;
  19. while(t--)
  20. {
  21. cin>>n;
  22. if(n%2==0) cout<<-1<<"\n";
  23. else
  24. {
  25. cout<<n<<" ";
  26. for(i=1;i<n;i++) cout<<i<<" ";
  27. cout<<"\n";
  28. }
  29. }
  30. re 0;
  31. }
  32.  
Success #stdin #stdout 0.01s 5320KB
stdin
4
2
3
4
5
stdout
-1
3 1 2 
-1
5 1 2 3 4