QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#422972#1464. Interactive AlgorithmDiuAC ✓116ms4900kbC++142.3kb2024-05-27 20:36:562024-05-27 20:36:57

Judging History

你现在查看的是最新测评结果

  • [2024-05-27 20:36:57]
  • 评测
  • 测评结果:AC
  • 用时:116ms
  • 内存:4900kb
  • [2024-05-27 20:36:56]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int N=510;
int n,mp[N][N],in[N];
vector<int> pl,ans;
int query(vector<int> p){
	printf("? ");for(int x:p)printf("%d ",x);puts("");
	fflush(stdout);
	int x;scanf("%d",&x);return x; 
} 
void link(int u,int v){mp[u][v]=mp[v][u]=1,in[u]++,in[v]++;}
void cir_query(int u,int v,int w){//查一个三元环 
	for(int i=3,p=1;i<n;i++){
		while(p==u||p==v||p==w)++p;
		pl[i]=p,++p;
	}
	pl[0]=u,pl[1]=w,pl[2]=v;
	int x1=query(pl);
	pl[0]=w,pl[1]=u,pl[2]=v;
	int x2=query(pl),d1=x1-x2;//(v,w)-(u,v)
	pl[0]=u,pl[1]=v,pl[2]=w;
	int x3=query(pl);
	pl[0]=v,pl[1]=u,pl[2]=w;
	int x4=query(pl),d2=x3-x4;//(v,w)-(u,w)
	if(d1==-1&&d2==-1)link(u,v),link(u,w);
	if(d1==-1&&d2==0)link(u,v);
	if(d1==-1&&d2==1)exit(0);
	if(d1==0&&d2==-1)link(u,w);
	if(d1==0&&d2==0);
	if(d1==0&&d2==1)link(u,v),link(v,w);
	if(d1==1&&d2==-1)exit(0);
	if(d1==1&&d2==0)link(u,w),link(v,w);
	if(d1==1&&d2==1)link(v,w);
}
int ban[N],cnt;
int gts(int d,int l,int r){//查询一段边的答案 
//l到r表示边(l,l+d),(l+1,l+d+1),...,(r,d+1) 
	if(l>r)return 0;
	for(int i=1;i<=n;i++)ban[i]=0;
	cnt=-1;
	for(int i=2;i<l;i++)pl[++cnt]=i,ban[i]=1;
	for(int i=0;i<d;i++){
		if(l+i>r)break;
		if(i&1){
			int num=l+i;
			while(num<=r)num+=d;//num-=d;
			while(num>=l)ban[num]=1,pl[++cnt]=num,num-=d;
		}else{
			int num=l+i;
			while(num<=r+d)ban[num]=1,pl[++cnt]=num,num+=d;
		}
	}
	for(int i=l+d-1;i>=1;i--)if(!ban[i])pl[++cnt]=i,ban[i]=1;
	for(int i=1;i<=n;i++)if(!ban[i])pl[++cnt]=i,ban[i]=1;
	int res=query(pl);
	for(int i=1;i<n;i++)if(mp[pl[i-1]][pl[i]])--res;
	return res;
}
void find(int d,int l,int r,int x){//二分,x表示当前层答案 
	if(l>r||!x)return;
	if(l==r)return link(l,l+d);
	int mid=l+r>>1,y=gts(d,l,mid);
	find(d,l,mid,y),find(d,mid+1,r,x-y);
}
signed main(){
	scanf("%d",&n);
	ans.clear(),pl.clear();
	ans.resize(n),pl.resize(n);
	if(n==2)ans[0]=1,ans[1]=2;
	else{
		for(int i=1;i<=n;i++){
			in[i]=0;
			for(int j=1;j<=n;j++)mp[i][j]=0;
		}
		for(int i=2;i<n;i++)cir_query(1,i,i+1);
		for(int d=2;d<n-1;d++)find(d,2,n-d,gts(d,2,n-d));
		int u=0,fa=0,p=0;
		for(int i=1;i<=n;i++)if(in[i]==1){u=i;break;}
		while(p<n){
			ans[p]=u;
			for(int i=1;i<=n;i++){
				if(u==i||fa==i||!mp[u][i])continue;
				fa=u,u=i;break;
			}
			++p;
		}
	}
	printf("! ");for(int x:ans)printf("%d ",x);
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 4096kb

input:

5
1
1
1
1
2
1
3
2
2
2
1
2
1
3
2

output:

? 1 3 2 4 5 
? 3 1 2 4 5 
? 1 2 3 4 5 
? 2 1 3 4 5 
? 1 4 3 2 5 
? 4 1 3 2 5 
? 1 3 4 2 5 
? 3 1 4 2 5 
? 1 5 4 2 3 
? 5 1 4 2 3 
? 1 4 5 2 3 
? 4 1 5 2 3 
? 2 4 5 3 1 
? 2 4 3 1 5 
? 2 5 4 3 1 
! 1 5 2 4 3 

result:

ok n=5, 15 queries

Test #2:

score: 0
Accepted
time: 0ms
memory: 3768kb

input:

2

output:

! 1 2 

result:

ok n=2, 0 queries

Test #3:

score: 0
Accepted
time: 0ms
memory: 3812kb

input:

3
1
1
2
1

output:

? 1 3 2 
? 3 1 2 
? 1 2 3 
? 2 1 3 
! 1 2 3 

result:

ok n=3, 4 queries

Test #4:

score: 0
Accepted
time: 1ms
memory: 4104kb

input:

4
2
2
0
1
1
2
2
3
2

output:

? 1 3 2 4 
? 3 1 2 4 
? 1 2 3 4 
? 2 1 3 4 
? 1 4 3 2 
? 4 1 3 2 
? 1 3 4 2 
? 3 1 4 2 
? 2 4 3 1 
! 2 4 1 3 

result:

ok n=4, 9 queries

Test #5:

score: 0
Accepted
time: 0ms
memory: 3752kb

input:

5
2
2
1
2
1
1
3
2
2
2
0
1
2
4
2

output:

? 1 3 2 4 5 
? 3 1 2 4 5 
? 1 2 3 4 5 
? 2 1 3 4 5 
? 1 4 3 2 5 
? 4 1 3 2 5 
? 1 3 4 2 5 
? 3 1 4 2 5 
? 1 5 4 2 3 
? 5 1 4 2 3 
? 1 4 5 2 3 
? 4 1 5 2 3 
? 2 4 5 3 1 
? 2 4 3 1 5 
? 2 5 4 3 1 
! 2 4 3 1 5 

result:

ok n=5, 15 queries

Test #6:

score: 0
Accepted
time: 0ms
memory: 3752kb

input:

7
1
1
0
1
1
2
2
2
1
1
1
2
2
3
3
3
1
1
0
0
2
1
2
2
1
2
1
2
1

output:

? 1 3 2 4 5 6 7 
? 3 1 2 4 5 6 7 
? 1 2 3 4 5 6 7 
? 2 1 3 4 5 6 7 
? 1 4 3 2 5 6 7 
? 4 1 3 2 5 6 7 
? 1 3 4 2 5 6 7 
? 3 1 4 2 5 6 7 
? 1 5 4 2 3 6 7 
? 5 1 4 2 3 6 7 
? 1 4 5 2 3 6 7 
? 4 1 5 2 3 6 7 
? 1 6 5 2 3 4 7 
? 6 1 5 2 3 4 7 
? 1 5 6 2 3 4 7 
? 5 1 6 2 3 4 7 
? 1 7 6 2 3 4 5 
? 7 1 6 2 3...

result:

ok n=7, 29 queries

Test #7:

score: 0
Accepted
time: 1ms
memory: 3828kb

input:

10
1
1
2
2
3
2
3
2
2
2
2
3
3
4
3
3
3
3
2
3
2
3
3
3
2
1
2
1
1
1
1
1
1
1
3
4
4
4
3
4
1
4
3
2
3
1
4
2
0
2

output:

? 1 3 2 4 5 6 7 8 9 10 
? 3 1 2 4 5 6 7 8 9 10 
? 1 2 3 4 5 6 7 8 9 10 
? 2 1 3 4 5 6 7 8 9 10 
? 1 4 3 2 5 6 7 8 9 10 
? 4 1 3 2 5 6 7 8 9 10 
? 1 3 4 2 5 6 7 8 9 10 
? 3 1 4 2 5 6 7 8 9 10 
? 1 5 4 2 3 6 7 8 9 10 
? 5 1 4 2 3 6 7 8 9 10 
? 1 4 5 2 3 6 7 8 9 10 
? 4 1 5 2 3 6 7 8 9 10 
? 1 6 5 2 3 ...

result:

ok n=10, 50 queries

Test #8:

score: 0
Accepted
time: 1ms
memory: 3844kb

input:

20
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
2
2
1
1
0
0
0
0
0
0
1
1
1
1
1
1
0
1
0
1
2
2
1
1
0
0
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0
1
0
2
2
2
4
2
0
1
1
1
0
1
1
1
0
2
1
0
1
2
1
1
0
1
1
2
1
1
1
0
2
0
0
2
2
0
1
1
1
1
0
2
1
1
1
2
1
1
0
0
1
1
0
1
1
1
2
1
0
1
0
1
0

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
? 3 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
? 2 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
? 1 4 3 2 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
? 4 1 3 2 5 6 7 8 9 10 11 12 1...

result:

ok n=20, 136 queries

Test #9:

score: 0
Accepted
time: 2ms
memory: 3868kb

input:

30
4
4
4
4
3
3
3
3
4
3
4
3
3
3
3
3
5
5
4
5
4
5
5
5
4
4
4
4
4
4
4
4
4
4
4
4
4
4
5
5
5
5
5
5
5
5
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
3
3
3
3
4
3
4
3
3
3
3
3
3
3
3
3
4
3
4
3
3
3
3
3
4
4
4
4
4
4
4
4
4
4
4
4
3
3
3
3
5
4
4
4
1
1
0
2
4
4
4
5
4
3
4
3
5
4
3
3
5
3
5
5
4
4
4
4
4
2
3
3
5
5
5
4
3
3
2
3
5...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 
? 3 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 
? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 
? 2 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1...

result:

ok n=30, 207 queries

Test #10:

score: 0
Accepted
time: 0ms
memory: 3956kb

input:

50
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
1
1
1
2
1
2
1
1
1
1
1
2
2
2
2
2
2
2
2
3
3
2
3
2
3
3
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
1
1
1
2
1
2
1
1
1
1
1
3
3
3
3
2
2
3
3
3
3
3
3
3
3
2
2
3
3
2
3
2
3
3
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 
? 3 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 
? 1 2 3 4 5 ...

result:

ok n=50, 418 queries

Test #11:

score: 0
Accepted
time: 7ms
memory: 4060kb

input:

123
4
4
5
5
5
4
5
4
4
4
4
4
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
4
4
4
4
5
4
5
4
4
4
4
4
5
5
6
6
6
6
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=123, 1215 queries

Test #12:

score: 0
Accepted
time: 17ms
memory: 4248kb

input:

185
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
2
3
2
3
3
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
2
2
2
2
2
2
2
2
2
2
3
3
3
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=185, 1977 queries

Test #13:

score: 0
Accepted
time: 56ms
memory: 4640kb

input:

277
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=277, 3113 queries

Test #14:

score: 0
Accepted
time: 73ms
memory: 4368kb

input:

300
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=300, 3445 queries

Test #15:

score: 0
Accepted
time: 66ms
memory: 4564kb

input:

347
6
6
5
6
5
6
6
6
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
4
4
4
4
5
4
5
4
4
4
4
4
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=347, 4002 queries

Test #16:

score: 0
Accepted
time: 75ms
memory: 4524kb

input:

366
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=366, 4274 queries

Test #17:

score: 0
Accepted
time: 79ms
memory: 4836kb

input:

398
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=398, 4737 queries

Test #18:

score: 0
Accepted
time: 93ms
memory: 4668kb

input:

399
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=399, 4763 queries

Test #19:

score: 0
Accepted
time: 79ms
memory: 4540kb

input:

400
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4762 queries

Test #20:

score: 0
Accepted
time: 1ms
memory: 4096kb

input:

3
2
1
1
1

output:

? 1 3 2 
? 3 1 2 
? 1 2 3 
? 2 1 3 
! 1 3 2 

result:

ok n=3, 4 queries

Test #21:

score: 0
Accepted
time: 1ms
memory: 3872kb

input:

4
2
2
0
1
1
2
2
3
2

output:

? 1 3 2 4 
? 3 1 2 4 
? 1 2 3 4 
? 2 1 3 4 
? 1 4 3 2 
? 4 1 3 2 
? 1 3 4 2 
? 3 1 4 2 
? 2 4 3 1 
! 2 4 1 3 

result:

ok n=4, 9 queries

Test #22:

score: 0
Accepted
time: 0ms
memory: 4068kb

input:

5
2
3
3
4
1
1
2
1
1
0
1
0
2
3

output:

? 1 3 2 4 5 
? 3 1 2 4 5 
? 1 2 3 4 5 
? 2 1 3 4 5 
? 1 4 3 2 5 
? 4 1 3 2 5 
? 1 3 4 2 5 
? 3 1 4 2 5 
? 1 5 4 2 3 
? 5 1 4 2 3 
? 1 4 5 2 3 
? 4 1 5 2 3 
? 2 4 5 3 1 
? 2 5 4 3 1 
! 2 1 3 4 5 

result:

ok n=5, 14 queries

Test #23:

score: 0
Accepted
time: 1ms
memory: 4112kb

input:

7
2
1
3
2
4
3
3
2
3
3
3
4
4
5
3
4
3
3
4
3
1
2
2
4
1
2

output:

? 1 3 2 4 5 6 7 
? 3 1 2 4 5 6 7 
? 1 2 3 4 5 6 7 
? 2 1 3 4 5 6 7 
? 1 4 3 2 5 6 7 
? 4 1 3 2 5 6 7 
? 1 3 4 2 5 6 7 
? 3 1 4 2 5 6 7 
? 1 5 4 2 3 6 7 
? 5 1 4 2 3 6 7 
? 1 4 5 2 3 6 7 
? 4 1 5 2 3 6 7 
? 1 6 5 2 3 4 7 
? 6 1 5 2 3 4 7 
? 1 5 6 2 3 4 7 
? 5 1 6 2 3 4 7 
? 1 7 6 2 3 4 5 
? 7 1 6 2 3...

result:

ok n=7, 26 queries

Test #24:

score: 0
Accepted
time: 1ms
memory: 3820kb

input:

10
1
2
3
3
2
1
2
1
1
1
1
1
3
3
2
3
3
4
4
4
1
1
1
1
3
2
3
2
1
1
1
1
1
2
2
3
4
2
3
3
3
3
0
2
4
2
1
0
2

output:

? 1 3 2 4 5 6 7 8 9 10 
? 3 1 2 4 5 6 7 8 9 10 
? 1 2 3 4 5 6 7 8 9 10 
? 2 1 3 4 5 6 7 8 9 10 
? 1 4 3 2 5 6 7 8 9 10 
? 4 1 3 2 5 6 7 8 9 10 
? 1 3 4 2 5 6 7 8 9 10 
? 3 1 4 2 5 6 7 8 9 10 
? 1 5 4 2 3 6 7 8 9 10 
? 5 1 4 2 3 6 7 8 9 10 
? 1 4 5 2 3 6 7 8 9 10 
? 4 1 5 2 3 6 7 8 9 10 
? 1 6 5 2 3 ...

result:

ok n=10, 49 queries

Test #25:

score: 0
Accepted
time: 1ms
memory: 4128kb

input:

20
2
2
3
2
2
2
1
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
2
2
2
2
1
1
1
1
2
1
2
1
2
2
1
2
2
3
3
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
1
3
2
2
1
2
2
2
2
3
1
3
2
2
1
2
2
1
4
1
3
0
0
0
2
1
2
0
2
2
1
2
1
2
3
2
0
3
2
3
2
1
2
2
1
3
2
1
3
3
1
1
1
1
1

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
? 3 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
? 2 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
? 1 4 3 2 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
? 4 1 3 2 5 6 7 8 9 10 11 12 1...

result:

ok n=20, 129 queries

Test #26:

score: 0
Accepted
time: 2ms
memory: 4152kb

input:

30
1
1
0
1
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
1
0
1
1
1
0
0
0
0
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
4
2
1
0
1
0
0
1
0
2
1
2
2
1
0
0
3
1
0
1
0
0
1
0
1
1
0
1
1
1
0
1
0
0
0
3
3...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 
? 3 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 
? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 
? 2 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1...

result:

ok n=30, 218 queries

Test #27:

score: 0
Accepted
time: 0ms
memory: 4152kb

input:

50
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
0
0
1
1
0
1
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
1
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 
? 3 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 
? 1 2 3 4 5 ...

result:

ok n=50, 428 queries

Test #28:

score: 0
Accepted
time: 7ms
memory: 4044kb

input:

123
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=123, 1249 queries

Test #29:

score: 0
Accepted
time: 17ms
memory: 4456kb

input:

185
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
2
3
2
3
3
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=185, 1959 queries

Test #30:

score: 0
Accepted
time: 30ms
memory: 4348kb

input:

277
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=277, 3145 queries

Test #31:

score: 0
Accepted
time: 43ms
memory: 4392kb

input:

300
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
1
0
1
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=300, 3437 queries

Test #32:

score: 0
Accepted
time: 82ms
memory: 4500kb

input:

347
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=347, 4052 queries

Test #33:

score: 0
Accepted
time: 89ms
memory: 4536kb

input:

366
4
4
4
4
4
4
4
4
5
5
5
5
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
3
3
3
3
4
3
4
3
3
3
3
3
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
5
5
5
5
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=366, 4276 queries

Test #34:

score: 0
Accepted
time: 88ms
memory: 4884kb

input:

398
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=398, 4766 queries

Test #35:

score: 0
Accepted
time: 66ms
memory: 4544kb

input:

399
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
4
4
4
4
5
4
5
4
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=399, 4685 queries

Test #36:

score: 0
Accepted
time: 84ms
memory: 4596kb

input:

400
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4772 queries

Test #37:

score: 0
Accepted
time: 1ms
memory: 3804kb

input:

3
1
1
2
1

output:

? 1 3 2 
? 3 1 2 
? 1 2 3 
? 2 1 3 
! 1 2 3 

result:

ok n=3, 4 queries

Test #38:

score: 0
Accepted
time: 0ms
memory: 3812kb

input:

4
2
2
0
1
1
2
2
3
2

output:

? 1 3 2 4 
? 3 1 2 4 
? 1 2 3 4 
? 2 1 3 4 
? 1 4 3 2 
? 4 1 3 2 
? 1 3 4 2 
? 3 1 4 2 
? 2 4 3 1 
! 2 4 1 3 

result:

ok n=4, 9 queries

Test #39:

score: 0
Accepted
time: 1ms
memory: 3812kb

input:

5
2
2
1
2
2
3
2
3
1
1
3
2
2
3

output:

? 1 3 2 4 5 
? 3 1 2 4 5 
? 1 2 3 4 5 
? 2 1 3 4 5 
? 1 4 3 2 5 
? 4 1 3 2 5 
? 1 3 4 2 5 
? 3 1 4 2 5 
? 1 5 4 2 3 
? 5 1 4 2 3 
? 1 4 5 2 3 
? 4 1 5 2 3 
? 2 4 5 3 1 
? 2 5 4 3 1 
! 2 5 4 1 3 

result:

ok n=5, 14 queries

Test #40:

score: 0
Accepted
time: 1ms
memory: 3820kb

input:

7
2
2
2
3
2
2
3
2
1
0
2
1
3
3
1
2
2
3
4
4
1
2
2
5
1
4

output:

? 1 3 2 4 5 6 7 
? 3 1 2 4 5 6 7 
? 1 2 3 4 5 6 7 
? 2 1 3 4 5 6 7 
? 1 4 3 2 5 6 7 
? 4 1 3 2 5 6 7 
? 1 3 4 2 5 6 7 
? 3 1 4 2 5 6 7 
? 1 5 4 2 3 6 7 
? 5 1 4 2 3 6 7 
? 1 4 5 2 3 6 7 
? 4 1 5 2 3 6 7 
? 1 6 5 2 3 4 7 
? 6 1 5 2 3 4 7 
? 1 5 6 2 3 4 7 
? 5 1 6 2 3 4 7 
? 1 7 6 2 3 4 5 
? 7 1 6 2 3...

result:

ok n=7, 26 queries

Test #41:

score: 0
Accepted
time: 1ms
memory: 3836kb

input:

10
2
1
2
1
2
2
1
1
3
3
2
3
3
4
3
4
2
3
3
3
1
1
1
1
2
1
3
2
2
2
1
1
1
1
3
2
1
3
2
2
1
2
0
3
3
2
1
2
1

output:

? 1 3 2 4 5 6 7 8 9 10 
? 3 1 2 4 5 6 7 8 9 10 
? 1 2 3 4 5 6 7 8 9 10 
? 2 1 3 4 5 6 7 8 9 10 
? 1 4 3 2 5 6 7 8 9 10 
? 4 1 3 2 5 6 7 8 9 10 
? 1 3 4 2 5 6 7 8 9 10 
? 3 1 4 2 5 6 7 8 9 10 
? 1 5 4 2 3 6 7 8 9 10 
? 5 1 4 2 3 6 7 8 9 10 
? 1 4 5 2 3 6 7 8 9 10 
? 4 1 5 2 3 6 7 8 9 10 
? 1 6 5 2 3 ...

result:

ok n=10, 49 queries

Test #42:

score: 0
Accepted
time: 1ms
memory: 3848kb

input:

20
1
1
2
2
2
1
2
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
3
3
4
4
2
3
3
4
4
4
2
2
2
2
2
2
2
2
3
3
2
3
2
3
3
3
1
1
1
1
2
1
3
2
2
2
1
1
2
2
2
2
2
2
2
2
2
2
2
2
3
3
3
1
3
3
3
2
1
3
2
4
3
2
4
2
2
2
2
2
2
3
2
4
2
2
3
4
2
4
2
2
2
4
3
4
1
3
2
3
3
2
3
2
2
1
3
2
3
3
2
2
2
2
3
2
1
3
2
2
2
1
2

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
? 3 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
? 2 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
? 1 4 3 2 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
? 4 1 3 2 5 6 7 8 9 10 11 12 1...

result:

ok n=20, 135 queries

Test #43:

score: 0
Accepted
time: 2ms
memory: 3860kb

input:

30
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
1
1
0
1
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
2
2
1
2
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
2
2
0
0
0
0
1
1
1
1
0
1
1
1
2
3
1
2
1
2
0
1
1
1
1
0
1
1
0
1
1
0
2
2
2
1...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 
? 3 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 
? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 
? 2 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1...

result:

ok n=30, 227 queries

Test #44:

score: 0
Accepted
time: 4ms
memory: 3976kb

input:

50
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
0
0
0
0
0...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 
? 3 1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 
? 1 2 3 4 5 ...

result:

ok n=50, 437 queries

Test #45:

score: 0
Accepted
time: 0ms
memory: 4332kb

input:

123
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
4
4
3
4
3
4
4
4
3
3
3
3
3
3
3
3
2
2
2
2
3
2
3
2
2
2
3
3
4
4
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
4
4
3
4
3
4
4
4
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=123, 1228 queries

Test #46:

score: 0
Accepted
time: 16ms
memory: 4464kb

input:

185
0
0
0
0
0
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=185, 1994 queries

Test #47:

score: 0
Accepted
time: 51ms
memory: 4432kb

input:

277
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=277, 3133 queries

Test #48:

score: 0
Accepted
time: 49ms
memory: 4432kb

input:

300
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=300, 3438 queries

Test #49:

score: 0
Accepted
time: 73ms
memory: 4492kb

input:

347
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=347, 4040 queries

Test #50:

score: 0
Accepted
time: 82ms
memory: 4796kb

input:

366
2
2
2
2
3
3
2
3
2
3
3
3
1
1
1
1
2
1
2
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=366, 4308 queries

Test #51:

score: 0
Accepted
time: 107ms
memory: 4604kb

input:

398
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
1
0
1
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=398, 4732 queries

Test #52:

score: 0
Accepted
time: 95ms
memory: 4616kb

input:

399
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=399, 4691 queries

Test #53:

score: 0
Accepted
time: 89ms
memory: 4656kb

input:

400
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4740 queries

Test #54:

score: 0
Accepted
time: 1ms
memory: 3816kb

input:

3
1
2
1
2

output:

? 1 3 2 
? 3 1 2 
? 1 2 3 
? 2 1 3 
! 2 1 3 

result:

ok n=3, 4 queries

Test #55:

score: 0
Accepted
time: 1ms
memory: 3764kb

input:

4
2
2
0
1
1
2
2
3
2

output:

? 1 3 2 4 
? 3 1 2 4 
? 1 2 3 4 
? 2 1 3 4 
? 1 4 3 2 
? 4 1 3 2 
? 1 3 4 2 
? 3 1 4 2 
? 2 4 3 1 
! 2 4 1 3 

result:

ok n=4, 9 queries

Test #56:

score: 0
Accepted
time: 1ms
memory: 3780kb

input:

5
1
1
0
1
2
3
2
3
0
1
2
2
2
1
2

output:

? 1 3 2 4 5 
? 3 1 2 4 5 
? 1 2 3 4 5 
? 2 1 3 4 5 
? 1 4 3 2 5 
? 4 1 3 2 5 
? 1 3 4 2 5 
? 3 1 4 2 5 
? 1 5 4 2 3 
? 5 1 4 2 3 
? 1 4 5 2 3 
? 4 1 5 2 3 
? 2 4 5 3 1 
? 2 4 3 1 5 
? 2 5 4 3 1 
! 2 5 3 1 4 

result:

ok n=5, 15 queries

Test #57:

score: 0
Accepted
time: 0ms
memory: 3816kb

input:

6
0
1
1
1
1
1
1
1
1
1
2
2
1
1
0
0
2
1
0
2
1
0

output:

? 1 3 2 4 5 6 
? 3 1 2 4 5 6 
? 1 2 3 4 5 6 
? 2 1 3 4 5 6 
? 1 4 3 2 5 6 
? 4 1 3 2 5 6 
? 1 3 4 2 5 6 
? 3 1 4 2 5 6 
? 1 5 4 2 3 6 
? 5 1 4 2 3 6 
? 1 4 5 2 3 6 
? 4 1 5 2 3 6 
? 1 6 5 2 3 4 
? 6 1 5 2 3 4 
? 1 5 6 2 3 4 
? 5 1 6 2 3 4 
? 2 4 6 5 3 1 
? 2 4 5 3 1 6 
? 2 4 3 1 5 6 
? 2 5 6 3 4 1 
...

result:

ok n=6, 22 queries

Test #58:

score: 0
Accepted
time: 1ms
memory: 3824kb

input:

7
0
0
0
0
1
1
1
1
1
1
1
2
1
2
2
2
2
2
0
1
1
0
3
2
2
1
2
2
0

output:

? 1 3 2 4 5 6 7 
? 3 1 2 4 5 6 7 
? 1 2 3 4 5 6 7 
? 2 1 3 4 5 6 7 
? 1 4 3 2 5 6 7 
? 4 1 3 2 5 6 7 
? 1 3 4 2 5 6 7 
? 3 1 4 2 5 6 7 
? 1 5 4 2 3 6 7 
? 5 1 4 2 3 6 7 
? 1 4 5 2 3 6 7 
? 4 1 5 2 3 6 7 
? 1 6 5 2 3 4 7 
? 6 1 5 2 3 4 7 
? 1 5 6 2 3 4 7 
? 5 1 6 2 3 4 7 
? 1 7 6 2 3 4 5 
? 7 1 6 2 3...

result:

ok n=7, 29 queries

Test #59:

score: 0
Accepted
time: 1ms
memory: 3820kb

input:

3
2
1
1
1

output:

? 1 3 2 
? 3 1 2 
? 1 2 3 
? 2 1 3 
! 1 3 2 

result:

ok n=3, 4 queries

Test #60:

score: 0
Accepted
time: 0ms
memory: 3756kb

input:

4
2
2
0
1
1
2
2
3
2

output:

? 1 3 2 4 
? 3 1 2 4 
? 1 2 3 4 
? 2 1 3 4 
? 1 4 3 2 
? 4 1 3 2 
? 1 3 4 2 
? 3 1 4 2 
? 2 4 3 1 
! 2 4 1 3 

result:

ok n=4, 9 queries

Test #61:

score: 0
Accepted
time: 1ms
memory: 3844kb

input:

5
2
1
2
1
2
2
0
1
2
2
3
2
2
0
1

output:

? 1 3 2 4 5 
? 3 1 2 4 5 
? 1 2 3 4 5 
? 2 1 3 4 5 
? 1 4 3 2 5 
? 4 1 3 2 5 
? 1 3 4 2 5 
? 3 1 4 2 5 
? 1 5 4 2 3 
? 5 1 4 2 3 
? 1 4 5 2 3 
? 4 1 5 2 3 
? 2 4 5 3 1 
? 2 4 3 1 5 
? 2 5 4 3 1 
! 2 3 5 4 1 

result:

ok n=5, 15 queries

Test #62:

score: 0
Accepted
time: 1ms
memory: 3848kb

input:

6
2
3
2
2
0
0
1
1
3
2
2
1
1
1
0
1
1
3
1
1
2
1

output:

? 1 3 2 4 5 6 
? 3 1 2 4 5 6 
? 1 2 3 4 5 6 
? 2 1 3 4 5 6 
? 1 4 3 2 5 6 
? 4 1 3 2 5 6 
? 1 3 4 2 5 6 
? 3 1 4 2 5 6 
? 1 5 4 2 3 6 
? 5 1 4 2 3 6 
? 1 4 5 2 3 6 
? 4 1 5 2 3 6 
? 1 6 5 2 3 4 
? 6 1 5 2 3 4 
? 1 5 6 2 3 4 
? 5 1 6 2 3 4 
? 2 4 6 5 3 1 
? 2 4 5 3 1 6 
? 2 4 3 1 5 6 
? 2 5 6 3 4 1 
...

result:

ok n=6, 22 queries

Test #63:

score: 0
Accepted
time: 0ms
memory: 3828kb

input:

7
0
1
2
2
1
0
1
0
0
0
0
0
1
1
2
2
2
2
1
1
2
0
2
1
2
2
1

output:

? 1 3 2 4 5 6 7 
? 3 1 2 4 5 6 7 
? 1 2 3 4 5 6 7 
? 2 1 3 4 5 6 7 
? 1 4 3 2 5 6 7 
? 4 1 3 2 5 6 7 
? 1 3 4 2 5 6 7 
? 3 1 4 2 5 6 7 
? 1 5 4 2 3 6 7 
? 5 1 4 2 3 6 7 
? 1 4 5 2 3 6 7 
? 4 1 5 2 3 6 7 
? 1 6 5 2 3 4 7 
? 6 1 5 2 3 4 7 
? 1 5 6 2 3 4 7 
? 5 1 6 2 3 4 7 
? 1 7 6 2 3 4 5 
? 7 1 6 2 3...

result:

ok n=7, 27 queries

Test #64:

score: 0
Accepted
time: 0ms
memory: 3776kb

input:

3
1
2
1
2

output:

? 1 3 2 
? 3 1 2 
? 1 2 3 
? 2 1 3 
! 2 1 3 

result:

ok n=3, 4 queries

Test #65:

score: 0
Accepted
time: 0ms
memory: 3808kb

input:

4
2
2
0
1
1
2
2
3
2

output:

? 1 3 2 4 
? 3 1 2 4 
? 1 2 3 4 
? 2 1 3 4 
? 1 4 3 2 
? 4 1 3 2 
? 1 3 4 2 
? 3 1 4 2 
? 2 4 3 1 
! 2 4 1 3 

result:

ok n=4, 9 queries

Test #66:

score: 0
Accepted
time: 0ms
memory: 4108kb

input:

5
0
0
1
1
3
2
2
2
1
2
2
3
0
2

output:

? 1 3 2 4 5 
? 3 1 2 4 5 
? 1 2 3 4 5 
? 2 1 3 4 5 
? 1 4 3 2 5 
? 4 1 3 2 5 
? 1 3 4 2 5 
? 3 1 4 2 5 
? 1 5 4 2 3 
? 5 1 4 2 3 
? 1 4 5 2 3 
? 4 1 5 2 3 
? 2 4 5 3 1 
? 2 5 4 3 1 
! 2 5 1 4 3 

result:

ok n=5, 14 queries

Test #67:

score: 0
Accepted
time: 1ms
memory: 3816kb

input:

6
3
2
2
1
2
2
2
2
2
2
1
1
3
2
2
2
3
3
2
1
1

output:

? 1 3 2 4 5 6 
? 3 1 2 4 5 6 
? 1 2 3 4 5 6 
? 2 1 3 4 5 6 
? 1 4 3 2 5 6 
? 4 1 3 2 5 6 
? 1 3 4 2 5 6 
? 3 1 4 2 5 6 
? 1 5 4 2 3 6 
? 5 1 4 2 3 6 
? 1 4 5 2 3 6 
? 4 1 5 2 3 6 
? 1 6 5 2 3 4 
? 6 1 5 2 3 4 
? 1 5 6 2 3 4 
? 5 1 6 2 3 4 
? 2 4 6 5 3 1 
? 2 4 5 3 1 6 
? 2 4 3 1 5 6 
? 2 5 6 3 4 1 
...

result:

ok n=6, 21 queries

Test #68:

score: 0
Accepted
time: 1ms
memory: 3796kb

input:

7
2
3
3
3
2
2
1
2
2
2
3
2
0
0
1
1
3
2
2
1
2
3
1
0
5
2
2

output:

? 1 3 2 4 5 6 7 
? 3 1 2 4 5 6 7 
? 1 2 3 4 5 6 7 
? 2 1 3 4 5 6 7 
? 1 4 3 2 5 6 7 
? 4 1 3 2 5 6 7 
? 1 3 4 2 5 6 7 
? 3 1 4 2 5 6 7 
? 1 5 4 2 3 6 7 
? 5 1 4 2 3 6 7 
? 1 4 5 2 3 6 7 
? 4 1 5 2 3 6 7 
? 1 6 5 2 3 4 7 
? 6 1 5 2 3 4 7 
? 1 5 6 2 3 4 7 
? 5 1 6 2 3 4 7 
? 1 7 6 2 3 4 5 
? 7 1 6 2 3...

result:

ok n=7, 27 queries

Test #69:

score: 0
Accepted
time: 68ms
memory: 4860kb

input:

400
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
1
1
1
2
1
2
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4741 queries

Test #70:

score: 0
Accepted
time: 100ms
memory: 4600kb

input:

400
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4734 queries

Test #71:

score: 0
Accepted
time: 105ms
memory: 4612kb

input:

400
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4738 queries

Test #72:

score: 0
Accepted
time: 86ms
memory: 4632kb

input:

400
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4789 queries

Test #73:

score: 0
Accepted
time: 95ms
memory: 4564kb

input:

400
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4747 queries

Test #74:

score: 0
Accepted
time: 103ms
memory: 4600kb

input:

400
3
2
3
2
3
3
2
2
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4745 queries

Test #75:

score: 0
Accepted
time: 98ms
memory: 4612kb

input:

400
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4794 queries

Test #76:

score: 0
Accepted
time: 82ms
memory: 4892kb

input:

400
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
4
4
4
4
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4779 queries

Test #77:

score: 0
Accepted
time: 108ms
memory: 4680kb

input:

400
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
1
1
1
2
1
2
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4730 queries

Test #78:

score: 0
Accepted
time: 93ms
memory: 4888kb

input:

400
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4765 queries

Test #79:

score: 0
Accepted
time: 99ms
memory: 4680kb

input:

400
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4769 queries

Test #80:

score: 0
Accepted
time: 87ms
memory: 4600kb

input:

400
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
4
4
4
4
3
3
3
3
3
3
3
3
3
3
4
4
4
4
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4718 queries

Test #81:

score: 0
Accepted
time: 96ms
memory: 4680kb

input:

400
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4753 queries

Test #82:

score: 0
Accepted
time: 98ms
memory: 4596kb

input:

400
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4746 queries

Test #83:

score: 0
Accepted
time: 103ms
memory: 4636kb

input:

400
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
4
4
4
4
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
2
2
2
2
3
2
3
2
2
2
2
2
3
3
3
3
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4768 queries

Test #84:

score: 0
Accepted
time: 110ms
memory: 4888kb

input:

400
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4786 queries

Test #85:

score: 0
Accepted
time: 113ms
memory: 4676kb

input:

400
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4737 queries

Test #86:

score: 0
Accepted
time: 100ms
memory: 4576kb

input:

400
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4729 queries

Test #87:

score: 0
Accepted
time: 92ms
memory: 4900kb

input:

400
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4723 queries

Test #88:

score: 0
Accepted
time: 98ms
memory: 4608kb

input:

400
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
1
1
1
2
1
2
1
1
1
1
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4755 queries

Test #89:

score: 0
Accepted
time: 96ms
memory: 4680kb

input:

400
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
5
5
5
5
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
5
5
5
5
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4743 queries

Test #90:

score: 0
Accepted
time: 96ms
memory: 4572kb

input:

400
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
4
4
4
4
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4694 queries

Test #91:

score: 0
Accepted
time: 114ms
memory: 4684kb

input:

400
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4772 queries

Test #92:

score: 0
Accepted
time: 103ms
memory: 4608kb

input:

400
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
1
1
1
2
1
2
1
1
1
1
1
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4766 queries

Test #93:

score: 0
Accepted
time: 98ms
memory: 4620kb

input:

400
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4752 queries

Test #94:

score: 0
Accepted
time: 116ms
memory: 4892kb

input:

400
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4782 queries

Test #95:

score: 0
Accepted
time: 104ms
memory: 4888kb

input:

400
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4732 queries

Test #96:

score: 0
Accepted
time: 113ms
memory: 4616kb

input:

400
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
2
3
2
3
3
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4760 queries

Test #97:

score: 0
Accepted
time: 80ms
memory: 4604kb

input:

400
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
4
4
4
4
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4790 queries

Test #98:

score: 0
Accepted
time: 85ms
memory: 4612kb

input:

400
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4718 queries

Test #99:

score: 0
Accepted
time: 0ms
memory: 3824kb

input:

5
3
3
1
2
0
1
2
2
3
2
1
1
3
3
2

output:

? 1 3 2 4 5 
? 3 1 2 4 5 
? 1 2 3 4 5 
? 2 1 3 4 5 
? 1 4 3 2 5 
? 4 1 3 2 5 
? 1 3 4 2 5 
? 3 1 4 2 5 
? 1 5 4 2 3 
? 5 1 4 2 3 
? 1 4 5 2 3 
? 4 1 5 2 3 
? 2 4 5 3 1 
? 2 4 3 1 5 
? 2 5 4 3 1 
! 2 4 5 1 3 

result:

ok n=5, 15 queries

Test #100:

score: 0
Accepted
time: 95ms
memory: 4884kb

input:

400
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
5
5
5
5
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
...

output:

? 1 3 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok n=400, 4709 queries

Test #101:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

4
2
1
1
1
2
3
1
2
1

output:

? 1 3 2 4 
? 3 1 2 4 
? 1 2 3 4 
? 2 1 3 4 
? 1 4 3 2 
? 4 1 3 2 
? 1 3 4 2 
? 3 1 4 2 
? 2 4 3 1 
! 2 3 1 4 

result:

ok n=4, 9 queries

Test #102:

score: 0
Accepted
time: 1ms
memory: 3848kb

input:

5
1
2
2
2
1
0
2
1
1
1
0
0
2
2
1

output:

? 1 3 2 4 5 
? 3 1 2 4 5 
? 1 2 3 4 5 
? 2 1 3 4 5 
? 1 4 3 2 5 
? 4 1 3 2 5 
? 1 3 4 2 5 
? 3 1 4 2 5 
? 1 5 4 2 3 
? 5 1 4 2 3 
? 1 4 5 2 3 
? 4 1 5 2 3 
? 2 4 5 3 1 
? 2 4 3 1 5 
? 2 5 4 3 1 
! 1 2 4 3 5 

result:

ok n=5, 15 queries

Test #103:

score: 0
Accepted
time: 1ms
memory: 3832kb

input:

6
3
2
3
2
3
3
1
2
2
2
3
2
2
1
3
2
1
2
3

output:

? 1 3 2 4 5 6 
? 3 1 2 4 5 6 
? 1 2 3 4 5 6 
? 2 1 3 4 5 6 
? 1 4 3 2 5 6 
? 4 1 3 2 5 6 
? 1 3 4 2 5 6 
? 3 1 4 2 5 6 
? 1 5 4 2 3 6 
? 5 1 4 2 3 6 
? 1 4 5 2 3 6 
? 4 1 5 2 3 6 
? 1 6 5 2 3 4 
? 6 1 5 2 3 4 
? 1 5 6 2 3 4 
? 5 1 6 2 3 4 
? 2 4 6 5 3 1 
? 2 5 6 3 4 1 
? 2 6 5 4 3 1 
! 3 2 6 5 4 1 

result:

ok n=6, 19 queries

Test #104:

score: 0
Accepted
time: 1ms
memory: 3756kb

input:

7
3
2
4
3
6
5
4
4
2
3
4
4
4
3
3
2
3
2
3
2
1
3
4
3
2
3

output:

? 1 3 2 4 5 6 7 
? 3 1 2 4 5 6 7 
? 1 2 3 4 5 6 7 
? 2 1 3 4 5 6 7 
? 1 4 3 2 5 6 7 
? 4 1 3 2 5 6 7 
? 1 3 4 2 5 6 7 
? 3 1 4 2 5 6 7 
? 1 5 4 2 3 6 7 
? 5 1 4 2 3 6 7 
? 1 4 5 2 3 6 7 
? 4 1 5 2 3 6 7 
? 1 6 5 2 3 4 7 
? 6 1 5 2 3 4 7 
? 1 5 6 2 3 4 7 
? 5 1 6 2 3 4 7 
? 1 7 6 2 3 4 5 
? 7 1 6 2 3...

result:

ok n=7, 26 queries

Test #105:

score: 0
Accepted
time: 0ms
memory: 4068kb

input:

4
2
3
1
2
0
1
2
2
2

output:

? 1 3 2 4 
? 3 1 2 4 
? 1 2 3 4 
? 2 1 3 4 
? 1 4 3 2 
? 4 1 3 2 
? 1 3 4 2 
? 3 1 4 2 
? 2 4 3 1 
! 4 2 1 3 

result:

ok n=4, 9 queries

Test #106:

score: 0
Accepted
time: 1ms
memory: 4100kb

input:

5
1
0
2
1
4
3
2
2
1
2
3
3
0
2

output:

? 1 3 2 4 5 
? 3 1 2 4 5 
? 1 2 3 4 5 
? 2 1 3 4 5 
? 1 4 3 2 5 
? 4 1 3 2 5 
? 1 3 4 2 5 
? 3 1 4 2 5 
? 1 5 4 2 3 
? 5 1 4 2 3 
? 1 4 5 2 3 
? 4 1 5 2 3 
? 2 4 5 3 1 
? 2 5 4 3 1 
! 5 2 3 4 1 

result:

ok n=5, 14 queries

Test #107:

score: 0
Accepted
time: 1ms
memory: 3824kb

input:

6
2
1
1
0
2
2
1
2
2
3
2
2
2
2
1
2
2
3
1
1
0

output:

? 1 3 2 4 5 6 
? 3 1 2 4 5 6 
? 1 2 3 4 5 6 
? 2 1 3 4 5 6 
? 1 4 3 2 5 6 
? 4 1 3 2 5 6 
? 1 3 4 2 5 6 
? 3 1 4 2 5 6 
? 1 5 4 2 3 6 
? 5 1 4 2 3 6 
? 1 4 5 2 3 6 
? 4 1 5 2 3 6 
? 1 6 5 2 3 4 
? 6 1 5 2 3 4 
? 1 5 6 2 3 4 
? 5 1 6 2 3 4 
? 2 4 6 5 3 1 
? 2 4 5 3 1 6 
? 2 4 3 1 5 6 
? 2 5 6 3 4 1 
...

result:

ok n=6, 21 queries

Test #108:

score: 0
Accepted
time: 1ms
memory: 4072kb

input:

7
2
2
1
2
2
3
2
3
0
1
1
1
1
0
2
1
1
1
1
1
2
2
2
1
3
3
3

output:

? 1 3 2 4 5 6 7 
? 3 1 2 4 5 6 7 
? 1 2 3 4 5 6 7 
? 2 1 3 4 5 6 7 
? 1 4 3 2 5 6 7 
? 4 1 3 2 5 6 7 
? 1 3 4 2 5 6 7 
? 3 1 4 2 5 6 7 
? 1 5 4 2 3 6 7 
? 5 1 4 2 3 6 7 
? 1 4 5 2 3 6 7 
? 4 1 5 2 3 6 7 
? 1 6 5 2 3 4 7 
? 6 1 5 2 3 4 7 
? 1 5 6 2 3 4 7 
? 5 1 6 2 3 4 7 
? 1 7 6 2 3 4 5 
? 7 1 6 2 3...

result:

ok n=7, 27 queries

Test #109:

score: 0
Accepted
time: 1ms
memory: 4096kb

input:

4
2
3
1
2
0
1
2
2
2

output:

? 1 3 2 4 
? 3 1 2 4 
? 1 2 3 4 
? 2 1 3 4 
? 1 4 3 2 
? 4 1 3 2 
? 1 3 4 2 
? 3 1 4 2 
? 2 4 3 1 
! 4 2 1 3 

result:

ok n=4, 9 queries

Test #110:

score: 0
Accepted
time: 0ms
memory: 3888kb

input:

5
2
1
1
1
3
4
2
3
1
2
3
3
1
2

output:

? 1 3 2 4 5 
? 3 1 2 4 5 
? 1 2 3 4 5 
? 2 1 3 4 5 
? 1 4 3 2 5 
? 4 1 3 2 5 
? 1 3 4 2 5 
? 3 1 4 2 5 
? 1 5 4 2 3 
? 5 1 4 2 3 
? 1 4 5 2 3 
? 4 1 5 2 3 
? 2 4 5 3 1 
? 2 5 4 3 1 
! 5 2 3 1 4 

result:

ok n=5, 14 queries

Test #111:

score: 0
Accepted
time: 1ms
memory: 4100kb

input:

6
2
3
3
3
2
1
3
2
1
1
0
0
2
1
2
1
3
2
3
2
2

output:

? 1 3 2 4 5 6 
? 3 1 2 4 5 6 
? 1 2 3 4 5 6 
? 2 1 3 4 5 6 
? 1 4 3 2 5 6 
? 4 1 3 2 5 6 
? 1 3 4 2 5 6 
? 3 1 4 2 5 6 
? 1 5 4 2 3 6 
? 5 1 4 2 3 6 
? 1 4 5 2 3 6 
? 4 1 5 2 3 6 
? 1 6 5 2 3 4 
? 6 1 5 2 3 4 
? 1 5 6 2 3 4 
? 5 1 6 2 3 4 
? 2 4 6 5 3 1 
? 2 4 5 3 1 6 
? 2 4 3 1 5 6 
? 2 5 6 3 4 1 
...

result:

ok n=6, 21 queries

Test #112:

score: 0
Accepted
time: 1ms
memory: 4104kb

input:

7
0
0
0
0
0
0
0
0
1
1
0
1
2
3
3
4
1
2
2
2
1
2
1
1
0
2
1
1

output:

? 1 3 2 4 5 6 7 
? 3 1 2 4 5 6 7 
? 1 2 3 4 5 6 7 
? 2 1 3 4 5 6 7 
? 1 4 3 2 5 6 7 
? 4 1 3 2 5 6 7 
? 1 3 4 2 5 6 7 
? 3 1 4 2 5 6 7 
? 1 5 4 2 3 6 7 
? 5 1 4 2 3 6 7 
? 1 4 5 2 3 6 7 
? 4 1 5 2 3 6 7 
? 1 6 5 2 3 4 7 
? 6 1 5 2 3 4 7 
? 1 5 6 2 3 4 7 
? 5 1 6 2 3 4 7 
? 1 7 6 2 3 4 5 
? 7 1 6 2 3...

result:

ok n=7, 28 queries

Test #113:

score: 0
Accepted
time: 0ms
memory: 4036kb

input:

4
1
0
2
1
3
2
1
1
1

output:

? 1 3 2 4 
? 3 1 2 4 
? 1 2 3 4 
? 2 1 3 4 
? 1 4 3 2 
? 4 1 3 2 
? 1 3 4 2 
? 3 1 4 2 
? 2 4 3 1 
! 1 4 3 2 

result:

ok n=4, 9 queries

Test #114:

score: 0
Accepted
time: 0ms
memory: 3752kb

input:

5
2
3
1
2
0
1
2
2
1
1
0
0
3
2
1

output:

? 1 3 2 4 5 
? 3 1 2 4 5 
? 1 2 3 4 5 
? 2 1 3 4 5 
? 1 4 3 2 5 
? 4 1 3 2 5 
? 1 3 4 2 5 
? 3 1 4 2 5 
? 1 5 4 2 3 
? 5 1 4 2 3 
? 1 4 5 2 3 
? 4 1 5 2 3 
? 2 4 5 3 1 
? 2 4 3 1 5 
? 2 5 4 3 1 
! 4 2 1 3 5 

result:

ok n=5, 15 queries

Test #115:

score: 0
Accepted
time: 1ms
memory: 3812kb

input:

6
2
1
2
1
4
4
2
3
1
2
3
3
3
2
2
1
2
0
3
1
1

output:

? 1 3 2 4 5 6 
? 3 1 2 4 5 6 
? 1 2 3 4 5 6 
? 2 1 3 4 5 6 
? 1 4 3 2 5 6 
? 4 1 3 2 5 6 
? 1 3 4 2 5 6 
? 3 1 4 2 5 6 
? 1 5 4 2 3 6 
? 5 1 4 2 3 6 
? 1 4 5 2 3 6 
? 4 1 5 2 3 6 
? 1 6 5 2 3 4 
? 6 1 5 2 3 4 
? 1 5 6 2 3 4 
? 5 1 6 2 3 4 
? 2 4 6 5 3 1 
? 2 4 5 3 1 6 
? 2 5 6 3 4 1 
? 2 5 4 3 1 6 
...

result:

ok n=6, 21 queries

Test #116:

score: 0
Accepted
time: 1ms
memory: 3816kb

input:

7
1
1
2
2
1
0
1
0
2
1
2
1
1
1
2
2
4
4
2
3
1
1
2
3
3
2
2
4
2

output:

? 1 3 2 4 5 6 7 
? 3 1 2 4 5 6 7 
? 1 2 3 4 5 6 7 
? 2 1 3 4 5 6 7 
? 1 4 3 2 5 6 7 
? 4 1 3 2 5 6 7 
? 1 3 4 2 5 6 7 
? 3 1 4 2 5 6 7 
? 1 5 4 2 3 6 7 
? 5 1 4 2 3 6 7 
? 1 4 5 2 3 6 7 
? 4 1 5 2 3 6 7 
? 1 6 5 2 3 4 7 
? 6 1 5 2 3 4 7 
? 1 5 6 2 3 4 7 
? 5 1 6 2 3 4 7 
? 1 7 6 2 3 4 5 
? 7 1 6 2 3...

result:

ok n=7, 29 queries

Test #117:

score: 0
Accepted
time: 1ms
memory: 3816kb

input:

4
2
2
1
2
1
1
3
2
3

output:

? 1 3 2 4 
? 3 1 2 4 
? 1 2 3 4 
? 2 1 3 4 
? 1 4 3 2 
? 4 1 3 2 
? 1 3 4 2 
? 3 1 4 2 
? 2 4 3 1 
! 2 4 3 1 

result:

ok n=4, 9 queries

Test #118:

score: 0
Accepted
time: 1ms
memory: 4092kb

input:

5
3
2
2
2
2
3
2
2
2
1
3
2
2
3

output:

? 1 3 2 4 5 
? 3 1 2 4 5 
? 1 2 3 4 5 
? 2 1 3 4 5 
? 1 4 3 2 5 
? 4 1 3 2 5 
? 1 3 4 2 5 
? 3 1 4 2 5 
? 1 5 4 2 3 
? 5 1 4 2 3 
? 1 4 5 2 3 
? 4 1 5 2 3 
? 2 4 5 3 1 
? 2 5 4 3 1 
! 4 5 2 3 1 

result:

ok n=5, 14 queries

Test #119:

score: 0
Accepted
time: 1ms
memory: 4108kb

input:

6
2
3
4
4
2
1
2
1
1
0
1
0
3
2
2
2
1
2
3

output:

? 1 3 2 4 5 6 
? 3 1 2 4 5 6 
? 1 2 3 4 5 6 
? 2 1 3 4 5 6 
? 1 4 3 2 5 6 
? 4 1 3 2 5 6 
? 1 3 4 2 5 6 
? 3 1 4 2 5 6 
? 1 5 4 2 3 6 
? 5 1 4 2 3 6 
? 1 4 5 2 3 6 
? 4 1 5 2 3 6 
? 1 6 5 2 3 4 
? 6 1 5 2 3 4 
? 1 5 6 2 3 4 
? 5 1 6 2 3 4 
? 2 4 6 5 3 1 
? 2 5 6 3 4 1 
? 2 6 5 4 3 1 
! 2 1 6 5 4 3 

result:

ok n=6, 19 queries

Test #120:

score: 0
Accepted
time: 1ms
memory: 4100kb

input:

7
3
3
1
2
0
1
2
2
2
1
1
0
1
1
0
1
1
2
3
3
3
5
2
0
2
3

output:

? 1 3 2 4 5 6 7 
? 3 1 2 4 5 6 7 
? 1 2 3 4 5 6 7 
? 2 1 3 4 5 6 7 
? 1 4 3 2 5 6 7 
? 4 1 3 2 5 6 7 
? 1 3 4 2 5 6 7 
? 3 1 4 2 5 6 7 
? 1 5 4 2 3 6 7 
? 5 1 4 2 3 6 7 
? 1 4 5 2 3 6 7 
? 4 1 5 2 3 6 7 
? 1 6 5 2 3 4 7 
? 6 1 5 2 3 4 7 
? 1 5 6 2 3 4 7 
? 5 1 6 2 3 4 7 
? 1 7 6 2 3 4 5 
? 7 1 6 2 3...

result:

ok n=7, 26 queries

Test #121:

score: 0
Accepted
time: 1ms
memory: 3844kb

input:

4
2
2
1
2
1
1
3
2
3

output:

? 1 3 2 4 
? 3 1 2 4 
? 1 2 3 4 
? 2 1 3 4 
? 1 4 3 2 
? 4 1 3 2 
? 1 3 4 2 
? 3 1 4 2 
? 2 4 3 1 
! 2 4 3 1 

result:

ok n=4, 9 queries

Test #122:

score: 0
Accepted
time: 0ms
memory: 3828kb

input:

5
0
1
2
2
2
1
2
1
0
0
1
1
1
1
2

output:

? 1 3 2 4 5 
? 3 1 2 4 5 
? 1 2 3 4 5 
? 2 1 3 4 5 
? 1 4 3 2 5 
? 4 1 3 2 5 
? 1 3 4 2 5 
? 3 1 4 2 5 
? 1 5 4 2 3 
? 5 1 4 2 3 
? 1 4 5 2 3 
? 4 1 5 2 3 
? 2 4 5 3 1 
? 2 4 3 1 5 
? 2 5 4 3 1 
! 1 2 5 3 4 

result:

ok n=5, 15 queries

Test #123:

score: 0
Accepted
time: 1ms
memory: 3788kb

input:

6
2
3
3
4
3
3
4
3
0
0
1
1
3
2
2
1
2
3
3
3

output:

? 1 3 2 4 5 6 
? 3 1 2 4 5 6 
? 1 2 3 4 5 6 
? 2 1 3 4 5 6 
? 1 4 3 2 5 6 
? 4 1 3 2 5 6 
? 1 3 4 2 5 6 
? 3 1 4 2 5 6 
? 1 5 4 2 3 6 
? 5 1 4 2 3 6 
? 1 4 5 2 3 6 
? 4 1 5 2 3 6 
? 1 6 5 2 3 4 
? 6 1 5 2 3 4 
? 1 5 6 2 3 4 
? 5 1 6 2 3 4 
? 2 4 6 5 3 1 
? 2 5 6 3 4 1 
? 2 5 4 3 1 6 
? 2 6 5 4 3 1 
...

result:

ok n=6, 20 queries

Test #124:

score: 0
Accepted
time: 1ms
memory: 3752kb

input:

7
1
2
2
2
2
2
1
2
0
1
1
1
1
0
1
0
0
0
0
0
2
0
2
1
2
1
1

output:

? 1 3 2 4 5 6 7 
? 3 1 2 4 5 6 7 
? 1 2 3 4 5 6 7 
? 2 1 3 4 5 6 7 
? 1 4 3 2 5 6 7 
? 4 1 3 2 5 6 7 
? 1 3 4 2 5 6 7 
? 3 1 4 2 5 6 7 
? 1 5 4 2 3 6 7 
? 5 1 4 2 3 6 7 
? 1 4 5 2 3 6 7 
? 4 1 5 2 3 6 7 
? 1 6 5 2 3 4 7 
? 6 1 5 2 3 4 7 
? 1 5 6 2 3 4 7 
? 5 1 6 2 3 4 7 
? 1 7 6 2 3 4 5 
? 7 1 6 2 3...

result:

ok n=7, 27 queries

Test #125:

score: 0
Accepted
time: 0ms
memory: 3808kb

input:

4
1
1
2
1
2
2
0
1
0

output:

? 1 3 2 4 
? 3 1 2 4 
? 1 2 3 4 
? 2 1 3 4 
? 1 4 3 2 
? 4 1 3 2 
? 1 3 4 2 
? 3 1 4 2 
? 2 4 3 1 
! 3 2 1 4 

result:

ok n=4, 9 queries

Test #126:

score: 0
Accepted
time: 0ms
memory: 3888kb

input:

5
0
1
2
2
2
1
2
1
0
0
1
1
1
1
2

output:

? 1 3 2 4 5 
? 3 1 2 4 5 
? 1 2 3 4 5 
? 2 1 3 4 5 
? 1 4 3 2 5 
? 4 1 3 2 5 
? 1 3 4 2 5 
? 3 1 4 2 5 
? 1 5 4 2 3 
? 5 1 4 2 3 
? 1 4 5 2 3 
? 4 1 5 2 3 
? 2 4 5 3 1 
? 2 4 3 1 5 
? 2 5 4 3 1 
! 1 2 5 3 4 

result:

ok n=5, 15 queries

Test #127:

score: 0
Accepted
time: 1ms
memory: 3816kb

input:

6
1
2
3
3
3
2
3
2
1
1
2
2
3
2
2
1
1
4
2
2

output:

? 1 3 2 4 5 6 
? 3 1 2 4 5 6 
? 1 2 3 4 5 6 
? 2 1 3 4 5 6 
? 1 4 3 2 5 6 
? 4 1 3 2 5 6 
? 1 3 4 2 5 6 
? 3 1 4 2 5 6 
? 1 5 4 2 3 6 
? 5 1 4 2 3 6 
? 1 4 5 2 3 6 
? 4 1 5 2 3 6 
? 1 6 5 2 3 4 
? 6 1 5 2 3 4 
? 1 5 6 2 3 4 
? 5 1 6 2 3 4 
? 2 4 6 5 3 1 
? 2 5 6 3 4 1 
? 2 5 4 3 1 6 
? 2 6 5 4 3 1 
...

result:

ok n=6, 20 queries

Test #128:

score: 0
Accepted
time: 1ms
memory: 4076kb

input:

7
1
1
0
0
0
0
1
1
3
3
1
2
0
1
1
1
0
0
0
0
3
1
2
2
1
1
0
1
0
0

output:

? 1 3 2 4 5 6 7 
? 3 1 2 4 5 6 7 
? 1 2 3 4 5 6 7 
? 2 1 3 4 5 6 7 
? 1 4 3 2 5 6 7 
? 4 1 3 2 5 6 7 
? 1 3 4 2 5 6 7 
? 3 1 4 2 5 6 7 
? 1 5 4 2 3 6 7 
? 5 1 4 2 3 6 7 
? 1 4 5 2 3 6 7 
? 4 1 5 2 3 6 7 
? 1 6 5 2 3 4 7 
? 6 1 5 2 3 4 7 
? 1 5 6 2 3 4 7 
? 5 1 6 2 3 4 7 
? 1 7 6 2 3 4 5 
? 7 1 6 2 3...

result:

ok n=7, 30 queries

Test #129:

score: 0
Accepted
time: 1ms
memory: 3804kb

input:

4
2
1
1
1
2
3
1
2
1

output:

? 1 3 2 4 
? 3 1 2 4 
? 1 2 3 4 
? 2 1 3 4 
? 1 4 3 2 
? 4 1 3 2 
? 1 3 4 2 
? 3 1 4 2 
? 2 4 3 1 
! 2 3 1 4 

result:

ok n=4, 9 queries

Test #130:

score: 0
Accepted
time: 1ms
memory: 3888kb

input:

5
0
0
1
1
3
2
2
2
1
2
2
3
0
2

output:

? 1 3 2 4 5 
? 3 1 2 4 5 
? 1 2 3 4 5 
? 2 1 3 4 5 
? 1 4 3 2 5 
? 4 1 3 2 5 
? 1 3 4 2 5 
? 3 1 4 2 5 
? 1 5 4 2 3 
? 5 1 4 2 3 
? 1 4 5 2 3 
? 4 1 5 2 3 
? 2 4 5 3 1 
? 2 5 4 3 1 
! 2 5 1 4 3 

result:

ok n=5, 14 queries

Test #131:

score: 0
Accepted
time: 1ms
memory: 3788kb

input:

6
1
2
2
2
1
1
1
1
2
1
3
2
1
1
0
0
1
1
2
2
1

output:

? 1 3 2 4 5 6 
? 3 1 2 4 5 6 
? 1 2 3 4 5 6 
? 2 1 3 4 5 6 
? 1 4 3 2 5 6 
? 4 1 3 2 5 6 
? 1 3 4 2 5 6 
? 3 1 4 2 5 6 
? 1 5 4 2 3 6 
? 5 1 4 2 3 6 
? 1 4 5 2 3 6 
? 4 1 5 2 3 6 
? 1 6 5 2 3 4 
? 6 1 5 2 3 4 
? 1 5 6 2 3 4 
? 5 1 6 2 3 4 
? 2 4 6 5 3 1 
? 2 4 5 3 1 6 
? 2 5 6 3 4 1 
? 2 5 4 3 1 6 
...

result:

ok n=6, 21 queries

Test #132:

score: 0
Accepted
time: 0ms
memory: 3812kb

input:

7
2
3
2
3
2
3
3
3
0
0
1
1
3
2
2
1
0
0
0
0
1
3
2
2
1
2
2

output:

? 1 3 2 4 5 6 7 
? 3 1 2 4 5 6 7 
? 1 2 3 4 5 6 7 
? 2 1 3 4 5 6 7 
? 1 4 3 2 5 6 7 
? 4 1 3 2 5 6 7 
? 1 3 4 2 5 6 7 
? 3 1 4 2 5 6 7 
? 1 5 4 2 3 6 7 
? 5 1 4 2 3 6 7 
? 1 4 5 2 3 6 7 
? 4 1 5 2 3 6 7 
? 1 6 5 2 3 4 7 
? 6 1 5 2 3 4 7 
? 1 5 6 2 3 4 7 
? 5 1 6 2 3 4 7 
? 1 7 6 2 3 4 5 
? 7 1 6 2 3...

result:

ok n=7, 27 queries

Test #133:

score: 0
Accepted
time: 1ms
memory: 4072kb

input:

4
0
1
2
2
2
1
1
1
1

output:

? 1 3 2 4 
? 3 1 2 4 
? 1 2 3 4 
? 2 1 3 4 
? 1 4 3 2 
? 4 1 3 2 
? 1 3 4 2 
? 3 1 4 2 
? 2 4 3 1 
! 2 1 4 3 

result:

ok n=4, 9 queries

Test #134:

score: 0
Accepted
time: 1ms
memory: 3820kb

input:

5
0
1
2
2
1
0
1
0
1
1
0
1
1
2
1

output:

? 1 3 2 4 5 
? 3 1 2 4 5 
? 1 2 3 4 5 
? 2 1 3 4 5 
? 1 4 3 2 5 
? 4 1 3 2 5 
? 1 3 4 2 5 
? 3 1 4 2 5 
? 1 5 4 2 3 
? 5 1 4 2 3 
? 1 4 5 2 3 
? 4 1 5 2 3 
? 2 4 5 3 1 
? 2 4 3 1 5 
? 2 5 4 3 1 
! 2 1 5 3 4 

result:

ok n=5, 15 queries

Test #135:

score: 0
Accepted
time: 1ms
memory: 3816kb

input:

6
0
1
1
1
2
2
1
2
1
2
3
3
1
1
0
0
1
0
3
1
0

output:

? 1 3 2 4 5 6 
? 3 1 2 4 5 6 
? 1 2 3 4 5 6 
? 2 1 3 4 5 6 
? 1 4 3 2 5 6 
? 4 1 3 2 5 6 
? 1 3 4 2 5 6 
? 3 1 4 2 5 6 
? 1 5 4 2 3 6 
? 5 1 4 2 3 6 
? 1 4 5 2 3 6 
? 4 1 5 2 3 6 
? 1 6 5 2 3 4 
? 6 1 5 2 3 4 
? 1 5 6 2 3 4 
? 5 1 6 2 3 4 
? 2 4 6 5 3 1 
? 2 4 5 3 1 6 
? 2 5 6 3 4 1 
? 2 5 4 3 1 6 
...

result:

ok n=6, 21 queries

Test #136:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

7
0
0
1
1
2
1
2
1
0
0
1
1
3
3
1
2
2
3
3
4
1
1
3
3
3
3
0
2

output:

? 1 3 2 4 5 6 7 
? 3 1 2 4 5 6 7 
? 1 2 3 4 5 6 7 
? 2 1 3 4 5 6 7 
? 1 4 3 2 5 6 7 
? 4 1 3 2 5 6 7 
? 1 3 4 2 5 6 7 
? 3 1 4 2 5 6 7 
? 1 5 4 2 3 6 7 
? 5 1 4 2 3 6 7 
? 1 4 5 2 3 6 7 
? 4 1 5 2 3 6 7 
? 1 6 5 2 3 4 7 
? 6 1 5 2 3 4 7 
? 1 5 6 2 3 4 7 
? 5 1 6 2 3 4 7 
? 1 7 6 2 3 4 5 
? 7 1 6 2 3...

result:

ok n=7, 28 queries

Test #137:

score: 0
Accepted
time: 0ms
memory: 4104kb

input:

4
0
1
2
2
2
1
1
1
1

output:

? 1 3 2 4 
? 3 1 2 4 
? 1 2 3 4 
? 2 1 3 4 
? 1 4 3 2 
? 4 1 3 2 
? 1 3 4 2 
? 3 1 4 2 
? 2 4 3 1 
! 2 1 4 3 

result:

ok n=4, 9 queries

Test #138:

score: 0
Accepted
time: 1ms
memory: 4100kb

input:

5
2
3
2
3
0
1
1
1
1
0
1
0
3
1
2

output:

? 1 3 2 4 5 
? 3 1 2 4 5 
? 1 2 3 4 5 
? 2 1 3 4 5 
? 1 4 3 2 5 
? 4 1 3 2 5 
? 1 3 4 2 5 
? 3 1 4 2 5 
? 1 5 4 2 3 
? 5 1 4 2 3 
? 1 4 5 2 3 
? 4 1 5 2 3 
? 2 4 5 3 1 
? 2 4 3 1 5 
? 2 5 4 3 1 
! 2 1 3 5 4 

result:

ok n=5, 15 queries

Test #139:

score: 0
Accepted
time: 1ms
memory: 3816kb

input:

6
2
3
2
3
0
1
1
1
2
1
2
1
0
0
0
0
2
2
1
2
2

output:

? 1 3 2 4 5 6 
? 3 1 2 4 5 6 
? 1 2 3 4 5 6 
? 2 1 3 4 5 6 
? 1 4 3 2 5 6 
? 4 1 3 2 5 6 
? 1 3 4 2 5 6 
? 3 1 4 2 5 6 
? 1 5 4 2 3 6 
? 5 1 4 2 3 6 
? 1 4 5 2 3 6 
? 4 1 5 2 3 6 
? 1 6 5 2 3 4 
? 6 1 5 2 3 4 
? 1 5 6 2 3 4 
? 5 1 6 2 3 4 
? 2 4 6 5 3 1 
? 2 4 5 3 1 6 
? 2 5 6 3 4 1 
? 2 5 4 3 1 6 
...

result:

ok n=6, 21 queries

Test #140:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

7
1
1
0
0
0
0
1
1
1
1
0
0
2
2
2
3
1
2
1
1
3
3
1
0
1
0
2
1
0

output:

? 1 3 2 4 5 6 7 
? 3 1 2 4 5 6 7 
? 1 2 3 4 5 6 7 
? 2 1 3 4 5 6 7 
? 1 4 3 2 5 6 7 
? 4 1 3 2 5 6 7 
? 1 3 4 2 5 6 7 
? 3 1 4 2 5 6 7 
? 1 5 4 2 3 6 7 
? 5 1 4 2 3 6 7 
? 1 4 5 2 3 6 7 
? 4 1 5 2 3 6 7 
? 1 6 5 2 3 4 7 
? 6 1 5 2 3 4 7 
? 1 5 6 2 3 4 7 
? 5 1 6 2 3 4 7 
? 1 7 6 2 3 4 5 
? 7 1 6 2 3...

result:

ok n=7, 29 queries

Test #141:

score: 0
Accepted
time: 1ms
memory: 3756kb

input:

4
2
1
1
0
2
2
1
2
1

output:

? 1 3 2 4 
? 3 1 2 4 
? 1 2 3 4 
? 2 1 3 4 
? 1 4 3 2 
? 4 1 3 2 
? 1 3 4 2 
? 3 1 4 2 
? 2 4 3 1 
! 1 4 2 3 

result:

ok n=4, 9 queries

Test #142:

score: 0
Accepted
time: 1ms
memory: 3732kb

input:

5
1
0
1
0
3
3
1
2
2
3
3
4
0
1

output:

? 1 3 2 4 5 
? 3 1 2 4 5 
? 1 2 3 4 5 
? 2 1 3 4 5 
? 1 4 3 2 5 
? 4 1 3 2 5 
? 1 3 4 2 5 
? 3 1 4 2 5 
? 1 5 4 2 3 
? 5 1 4 2 3 
? 1 4 5 2 3 
? 4 1 5 2 3 
? 2 4 5 3 1 
? 2 5 4 3 1 
! 3 2 5 1 4 

result:

ok n=5, 14 queries

Test #143:

score: 0
Accepted
time: 1ms
memory: 3760kb

input:

6
1
2
2
2
0
0
0
0
2
1
2
1
1
1
0
1
1
3
0
1
2
1

output:

? 1 3 2 4 5 6 
? 3 1 2 4 5 6 
? 1 2 3 4 5 6 
? 2 1 3 4 5 6 
? 1 4 3 2 5 6 
? 4 1 3 2 5 6 
? 1 3 4 2 5 6 
? 3 1 4 2 5 6 
? 1 5 4 2 3 6 
? 5 1 4 2 3 6 
? 1 4 5 2 3 6 
? 4 1 5 2 3 6 
? 1 6 5 2 3 4 
? 6 1 5 2 3 4 
? 1 5 6 2 3 4 
? 5 1 6 2 3 4 
? 2 4 6 5 3 1 
? 2 4 5 3 1 6 
? 2 4 3 1 5 6 
? 2 5 6 3 4 1 
...

result:

ok n=6, 22 queries

Test #144:

score: 0
Accepted
time: 0ms
memory: 4100kb

input:

7
2
1
3
2
4
3
3
2
3
3
3
4
4
5
4
4
3
2
3
2
1
3
2
3
1
2

output:

? 1 3 2 4 5 6 7 
? 3 1 2 4 5 6 7 
? 1 2 3 4 5 6 7 
? 2 1 3 4 5 6 7 
? 1 4 3 2 5 6 7 
? 4 1 3 2 5 6 7 
? 1 3 4 2 5 6 7 
? 3 1 4 2 5 6 7 
? 1 5 4 2 3 6 7 
? 5 1 4 2 3 6 7 
? 1 4 5 2 3 6 7 
? 4 1 5 2 3 6 7 
? 1 6 5 2 3 4 7 
? 6 1 5 2 3 4 7 
? 1 5 6 2 3 4 7 
? 5 1 6 2 3 4 7 
? 1 7 6 2 3 4 5 
? 7 1 6 2 3...

result:

ok n=7, 26 queries