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
- #define fast()(ios_base::sync_with_stdio(0),cin.tie(NULL));
- int main()
- {
- fast()
- ll t ;
- cin >> t;
- while (t--)
- {
- ll n;
- cin>>n;
- ll x=n/2;
- if(x%2==1)
- {
- cout<<"NO"<<endl;
- }
- else
- {
- ll sum=0,i,j=1;
- cout<<"YES"<<endl;
- for(i=0;i<n;i++)
- {
- if(i<n/2)
- {
- cout<<2*(i+1)<<" ";
- sum+=(2*(i+1));
- }
- else
- {
- if(i==(n-1))
- {
- cout<<sum<<endl;
- }
- else
- {
- cout<<j<<" ";
- sum-=j;
- j+=2;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement