fork download
  1. def doubled_sequence(n):
  2. if n % 2 != 0:
  3. return -1
  4. else:
  5. sequence = []
  6. for i in range(1, n // 2 + 1):
  7. sequence.append(i)
  8. sequence.append(n - i + 1)
  9. return ' '.join(map(str, sequence))
  10.  
  11. t = int(input())
  12.  
  13. for _ in range(t):
  14. n = int(input())
  15. print(doubled_sequence(n))
Success #stdin #stdout 0.02s 9752KB
stdin
4
1
2
3
4
stdout
-1
1 2
-1
1 4 2 3