Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define ll long long
- int main()
- {
- ll t;
- cin >> t;
- while(t--) {
- ll n;
- cin >> n;
- if(n<5) {
- cout << -1 << endl;
- continue;
- }
- ll p = n - !(n%2);
- for(int i=1;i<=p;i++) {
- if(i%2==1) {
- cout << i << ' ';
- }
- }
- ll q;
- if(p%3==0) q = 6;
- if(p%3==2) q = 4;
- if(p%3==1) q = 2;
- cout << q << ' ';
- for(int i=2;i<=n;i++) {
- if(i%2==0&&i!=q) {
- cout << i << ' ';
- }
- }
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement