水1276
#include<stdio.h>
#include<string.h>
int main() {
int i,j,t,k,count,a[6010],n,sum;
scanf("%d",&t);
while(t--) {
scanf("%d",&n);
memset(a,0,sizeof(a));
sum=0;k=2;
while(sum<n-3) {
count=0;
for(j=1;j<=n;j++) {
if(a[j])
continue;
count++;
if(count==k) {
sum++;
a[j]=1;
count=0;
}
}
if(k==2)
k=3;
else
if(k==3)
k=2;
}
printf("1");
for(i=2;i<=n;i++)
if(!a[i])
printf(" %d",i);
printf("\n");
}
return 0;
}