fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. typedef long long int ll;
  5. int main(){
  6. ll t;
  7. cin>>t;
  8. while(t--){
  9. ll n;
  10. cin>>n;
  11. if(n%2!=0){
  12. ll b[n+1] = {0};
  13. for(ll i=1;i<=n;i++){
  14. b[i] = i-1;
  15. }
  16. b[1] = n;
  17.  
  18. //RRRRR
  19. for(ll i=1;i<=n;i++){
  20. cout<<b[i]<<" ";
  21. }
  22. }else{
  23. cout<<"-1";
  24. }
  25. cout<<"\n";
  26. }
  27.  
  28. return 0;
  29. }
Success #stdin #stdout 0s 5284KB
stdin
4
2
3
4
5
stdout
-1
3 1 2 
-1
5 1 2 3 4