QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#179815#1464. Interactive AlgorithmFISHER_AC ✓180ms3860kbC++142.2kb2023-09-15 10:14:352023-09-15 10:14:36

Judging History

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

  • [2023-09-15 10:14:36]
  • 评测
  • 测评结果:AC
  • 用时:180ms
  • 内存:3860kb
  • [2023-09-15 10:14:35]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int maxn = 400;
int n;
int q[maxn + 5];
int query() {
	printf("? ");
	for (int i = 1; i <= n; i++) printf("%d ", q[i]);
	puts(""), fflush(stdout);
	int rs;
	scanf("%d", &rs);
	return rs;
}
void answer() {
	printf("! ");
	for (int i = 1; i <= n; i++) printf("%d ", q[i]);
	puts(""), fflush(stdout);
}
bool e1[maxn + 5], e2[maxn + 5];
void c3(int v1, int v2, int v3, bool& a1, bool& a2, bool& a3) {
	int tp = 3;
	for (int i = 1; i <= n; i++)
		if (i != v1 && i != v2 && i != v3) q[++tp] = i;
	q[1] = v1, q[2] = v2, q[3] = v3;
	int d1 = query();
	swap(q[1], q[2]);
	d1 -= query();
	q[1] = v1, q[2] = v3, q[3] = v2;
	int d2 = query();
	swap(q[1], q[2]);
	d2 -= query();
	if (d1 > 0) a2 = 1, a1 = 1 - d2;
	else if (d1 < 0) a3 = 1, a1 = -d2;
	else {
		if (d2 > 0) a2 = a3 = 1;
		else if (d2 < 0) a1 = 1;
	}
}
int queryd(int r, int d) {
	const int l = 2;
	int tp = 0, rs = 0;
	int R = (r - l + 1) % d;
	int pos = (R & 1) ? r - R + 1 : l;
	for (int i = 1; i <= d; i++) {
		if ((i ^ R) & 1) {
			for (; pos <= r; pos += d) q[++tp] = pos;
			pos -= d;
		} else {
			for (; pos >= l; pos -= d) q[++tp] = pos;
			pos += d;
		}
		if (i < d) rs += e2[pos++];
	}
	q[++tp] = 1, rs += e1[pos];
	if (r < n) {
		q[++tp] = r + 1, rs += e1[r + 1];
		for (int i = r + 2; i <= n; i++) q[++tp] = i, rs += e2[i - 1];
	}
	assert(tp == n);
	return query() - rs;
}
int to[maxn + 5];
int deg[maxn + 5];
inline void addE(int u, int v) {
	deg[u]++, deg[v]++;
	to[u] ^= v, to[v] ^= u;
}
int main() {
	scanf("%d", &n);
	if (n == 2) {
		q[1] = 1, q[2] = 2;
		return answer(), 0;
	}
	for (int i = 2; i < n; i++) c3(1, i, i + 1, e1[i], e2[i], e1[i + 1]);
	e2[1] = e1[2];
	for (int i = 2; i <= n; i++)
		if (e1[i]) addE(1, i);
	for (int i = 2; i < n; i++)
		if (e2[i]) addE(i, i + 1);
	for (int i = 2; i < n; i++) {
		int r = i + 1, v = 0;
		while (r < n) {
			for (int j = 8; ~j; j--)
				if (int nr = r + (1 << j); nr <= n && queryd(nr, i) == v) r = nr;
			v++;
			if (++r <= n) addE(r, r - i);
		}
	}
	int u;
	for (int i = 1; i <= n; i++)
		if (deg[i] == 1) { u = i; break; }
	for (int i = 1, lst = 0; i <= n; i++) {
		q[i] = u;
		int t = lst;
		lst = u, u = to[u] ^ t;
	}
	answer();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

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

output:

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

result:

ok n=5, 16 queries

Test #2:

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

input:

2

output:

! 1 2 

result:

ok n=2, 0 queries

Test #3:

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

input:

3
2
1
1
1

output:

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

result:

ok n=3, 4 queries

Test #4:

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

input:

4
0
1
2
2
2
3
1
2
2

output:

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

result:

ok n=4, 9 queries

Test #5:

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

input:

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

output:

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

result:

ok n=5, 16 queries

Test #6:

score: 0
Accepted
time: 3ms
memory: 3616kb

input:

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

output:

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

result:

ok n=7, 32 queries

Test #7:

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

input:

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

output:

? 1 2 3 4 5 6 7 8 9 10 
? 2 1 3 4 5 6 7 8 9 10 
? 1 3 2 4 5 6 7 8 9 10 
? 3 1 2 4 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 4 3 2 5 6 7 8 9 10 
? 4 1 3 2 5 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 5 4 2 3 6 7 8 9 10 
? 5 1 4 2 3 6 7 8 9 10 
? 1 5 6 2 3 ...

result:

ok n=10, 52 queries

Test #8:

score: 0
Accepted
time: 8ms
memory: 3624kb

input:

20
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
2
2
1
1
0
0
1
1
0
0
0
0
1
1
1
1
0
1
1
1
2
2
0
1
0
0
1
1
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
1
1
1
0
1
1
1
4
2
0
1
1
3
2
2
2
4
2
3
3
4
3
4
0
0
0
0
1
0
1
2
2
2
1
1
2
2
1
2
1
1
1
1
0
1
1
1
1
1
0
0
0
2
1
0
0
2
2
1
2
0
0
2
2
2
2
2
2
2
1
1
0
1
2
0
1...

output:

? 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 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 3 4 2 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
? 3 1 4 2 5 6 7 8 9 10 11 12 1...

result:

ok n=20, 164 queries

Test #9:

score: 0
Accepted
time: 6ms
memory: 3616kb

input:

30
4
4
4
4
3
3
3
3
4
3
4
3
3
3
3
3
4
5
5
5
5
5
4
5
4
4
4
4
4
4
4
4
4
4
4
4
5
5
4
4
5
5
5
5
4
4
5
5
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
4
4
5
4
3
1
1
0
2
1
1
3
1
1
5
5
4
5
4
5
2
2
3
3
3
3
4
5
4
5
5
3
3
3
5
5
5
5
5
4
5...

output:

? 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 19 20 21 22 23 24 25 26 27 28 29 30 
? 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 1...

result:

ok n=30, 267 queries

Test #10:

score: 0
Accepted
time: 9ms
memory: 3628kb

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
2
3
3
3
3
3
2
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
3
3
2
2
3
3
3
3
2
2
3
3
2
3
3
3
3
3
2
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 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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 
? 2 1 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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 
? 1 3 2 4 5 ...

result:

ok n=50, 511 queries

Test #11:

score: 0
Accepted
time: 20ms
memory: 3628kb

input:

123
5
5
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
4
4
4
4
5
4
5
4
4
4
4
4
6
6
5
5
5
5
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
...

output:

? 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 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, 1535 queries

Test #12:

score: 0
Accepted
time: 40ms
memory: 3624kb

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
3
3
3
3
3
2
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
3
3
2
2
2
2
3
3
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 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 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, 2530 queries

Test #13:

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

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 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 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, 4020 queries

Test #14:

score: 0
Accepted
time: 58ms
memory: 3728kb

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 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 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, 4417 queries

Test #15:

score: 0
Accepted
time: 156ms
memory: 3676kb

input:

347
5
6
6
6
6
6
5
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 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 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, 5255 queries

Test #16:

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

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 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 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, 5584 queries

Test #17:

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

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 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 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, 6151 queries

Test #18:

score: 0
Accepted
time: 139ms
memory: 3624kb

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 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 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, 6170 queries

Test #19:

score: 0
Accepted
time: 169ms
memory: 3624kb

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 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 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, 6175 queries

Test #20:

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

input:

3
1
1
2
1

output:

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

result:

ok n=3, 4 queries

Test #21:

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

input:

4
0
1
2
2
2
3
1
2
2

output:

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

result:

ok n=4, 9 queries

Test #22:

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

input:

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

output:

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

result:

ok n=5, 14 queries

Test #23:

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

input:

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

output:

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

result:

ok n=7, 26 queries

Test #24:

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

input:

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

output:

? 1 2 3 4 5 6 7 8 9 10 
? 2 1 3 4 5 6 7 8 9 10 
? 1 3 2 4 5 6 7 8 9 10 
? 3 1 2 4 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 4 3 2 5 6 7 8 9 10 
? 4 1 3 2 5 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 5 4 2 3 6 7 8 9 10 
? 5 1 4 2 3 6 7 8 9 10 
? 1 5 6 2 3 ...

result:

ok n=10, 51 queries

Test #25:

score: 0
Accepted
time: 8ms
memory: 3680kb

input:

20
3
2
2
2
1
1
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
1
1
1
1
2
1
2
1
1
2
2
2
3
3
2
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
1
1
1
3
3
3
3
1
4
3
2
2
3
2
2
1
1
2
1
2
2
2
1
2
2
3
2
3
1
0
0
0
0
1
1
1
1
1
0
4
3
3
3
2
3
2
1
2
2
2
2
3
1
0
1
3
2
3
4
3
3
4
2
1
1
2
2
2
3
3
1
3
4
3
3
1...

output:

? 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 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 3 4 2 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
? 3 1 4 2 5 6 7 8 9 10 11 12 1...

result:

ok n=20, 155 queries

Test #26:

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

input:

30
0
1
1
1
1
1
0
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
1
1
1
1
1
0
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
1
1
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
2
1
1
2
0
2
3
2
1
3
1
0
0
0
1
2
2
2
1
2
2
1
1
1
1
0
1
2
1
1
3
3
3
0
0
1
0...

output:

? 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 19 20 21 22 23 24 25 26 27 28 29 30 
? 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 1...

result:

ok n=30, 269 queries

Test #27:

score: 0
Accepted
time: 3ms
memory: 3608kb

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
0
1
1
1
1
1
0
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
1
1
0
0
0
0
1
1
0
1
1
1
1
1
0
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 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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 
? 2 1 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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 
? 1 3 2 4 5 ...

result:

ok n=50, 515 queries

Test #28:

score: 0
Accepted
time: 23ms
memory: 3616kb

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
2
2
1
1
1
1
2
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 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 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, 1570 queries

Test #29:

score: 0
Accepted
time: 34ms
memory: 3632kb

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
3
3
2
2
2
2
3
3
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
3
2
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 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 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, 2523 queries

Test #30:

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

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
3
3
2
2
2
2
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
...

output:

? 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 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, 4014 queries

Test #31:

score: 0
Accepted
time: 53ms
memory: 3676kb

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 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 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, 4425 queries

Test #32:

score: 0
Accepted
time: 111ms
memory: 3676kb

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 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 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, 5255 queries

Test #33:

score: 0
Accepted
time: 97ms
memory: 3612kb

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
5
5
4
4
4
4
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
...

output:

? 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 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, 5568 queries

Test #34:

score: 0
Accepted
time: 132ms
memory: 3856kb

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
2
2
1
1
1
1
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
...

output:

? 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 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, 6161 queries

Test #35:

score: 0
Accepted
time: 157ms
memory: 3620kb

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 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 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, 6160 queries

Test #36:

score: 0
Accepted
time: 117ms
memory: 3636kb

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 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 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, 6180 queries

Test #37:

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

input:

3
2
1
1
1

output:

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

result:

ok n=3, 4 queries

Test #38:

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

input:

4
0
1
2
2
2
3
1
2
2

output:

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

result:

ok n=4, 9 queries

Test #39:

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

input:

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

output:

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

result:

ok n=5, 14 queries

Test #40:

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

input:

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

output:

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

result:

ok n=7, 26 queries

Test #41:

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

input:

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

output:

? 1 2 3 4 5 6 7 8 9 10 
? 2 1 3 4 5 6 7 8 9 10 
? 1 3 2 4 5 6 7 8 9 10 
? 3 1 2 4 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 4 3 2 5 6 7 8 9 10 
? 4 1 3 2 5 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 5 4 2 3 6 7 8 9 10 
? 5 1 4 2 3 6 7 8 9 10 
? 1 5 6 2 3 ...

result:

ok n=10, 52 queries

Test #42:

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

input:

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

output:

? 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 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 3 4 2 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
? 3 1 4 2 5 6 7 8 9 10 11 12 1...

result:

ok n=20, 151 queries

Test #43:

score: 0
Accepted
time: 6ms
memory: 3856kb

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
1
1
0
0
0
0
1
1
0
1
1
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
1
2
2
2
1
1
0
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
0
0
0
1
0
1
2
1
2
1
1
1
2
2
1
0
0
1
0
1
1
1
2
0
1
2
0
3
2
2
1
3
3
2
2
3...

output:

? 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 19 20 21 22 23 24 25 26 27 28 29 30 
? 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 1...

result:

ok n=30, 264 queries

Test #44:

score: 0
Accepted
time: 3ms
memory: 3728kb

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
1
1
0
0
0
0
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
1
1
1
1
0
0
0
0
0...

output:

? 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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 
? 2 1 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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 
? 1 3 2 4 5 ...

result:

ok n=50, 531 queries

Test #45:

score: 0
Accepted
time: 9ms
memory: 3676kb

input:

123
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
4
4
4
4
4
3
4
3
3
3
3
3
3
3
3
2
2
2
2
3
2
3
2
3
3
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
4
4
4
4
4
3
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 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 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, 1545 queries

Test #46:

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

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
1
1
0
0
...

output:

? 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 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, 2569 queries

Test #47:

score: 0
Accepted
time: 69ms
memory: 3628kb

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 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 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, 4019 queries

Test #48:

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

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 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 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, 4431 queries

Test #49:

score: 0
Accepted
time: 52ms
memory: 3676kb

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 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 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, 5269 queries

Test #50:

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

input:

366
2
2
2
2
2
3
3
3
3
3
2
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 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 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, 5607 queries

Test #51:

score: 0
Accepted
time: 117ms
memory: 3624kb

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
2
2
1
1
1
1
2
2
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 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 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, 6191 queries

Test #52:

score: 0
Accepted
time: 133ms
memory: 3640kb

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 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 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, 6192 queries

Test #53:

score: 0
Accepted
time: 142ms
memory: 3624kb

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 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 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, 6131 queries

Test #54:

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

input:

3
1
2
1
2

output:

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

result:

ok n=3, 4 queries

Test #55:

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

input:

4
0
1
2
2
2
3
1
2
2

output:

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

result:

ok n=4, 9 queries

Test #56:

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

input:

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

output:

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

result:

ok n=5, 15 queries

Test #57:

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

input:

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

output:

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

result:

ok n=6, 23 queries

Test #58:

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

input:

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

output:

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

result:

ok n=7, 31 queries

Test #59:

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

input:

3
1
1
2
1

output:

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

result:

ok n=3, 4 queries

Test #60:

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

input:

4
0
1
2
2
2
3
1
2
2

output:

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

result:

ok n=4, 9 queries

Test #61:

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

input:

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

output:

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

result:

ok n=5, 15 queries

Test #62:

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

input:

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

output:

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

result:

ok n=6, 22 queries

Test #63:

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

input:

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

output:

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

result:

ok n=7, 30 queries

Test #64:

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

input:

3
1
2
1
2

output:

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

result:

ok n=3, 4 queries

Test #65:

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

input:

4
0
1
2
2
2
3
1
2
2

output:

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

result:

ok n=4, 9 queries

Test #66:

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

input:

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

output:

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

result:

ok n=5, 14 queries

Test #67:

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

input:

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

output:

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

result:

ok n=6, 23 queries

Test #68:

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

input:

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

output:

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

result:

ok n=7, 30 queries

Test #69:

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

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 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 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, 6158 queries

Test #70:

score: 0
Accepted
time: 167ms
memory: 3724kb

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 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 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, 6220 queries

Test #71:

score: 0
Accepted
time: 154ms
memory: 3724kb

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 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 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, 6206 queries

Test #72:

score: 0
Accepted
time: 141ms
memory: 3616kb

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 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 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, 6198 queries

Test #73:

score: 0
Accepted
time: 134ms
memory: 3620kb

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 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 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, 6193 queries

Test #74:

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

input:

400
3
2
3
2
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
3
3
...

output:

? 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 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, 6218 queries

Test #75:

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

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 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 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, 6207 queries

Test #76:

score: 0
Accepted
time: 139ms
memory: 3628kb

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 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 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, 6214 queries

Test #77:

score: 0
Accepted
time: 149ms
memory: 3676kb

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
3
3
2
2
2
2
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
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 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 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, 6190 queries

Test #78:

score: 0
Accepted
time: 127ms
memory: 3572kb

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 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 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, 6170 queries

Test #79:

score: 0
Accepted
time: 170ms
memory: 3672kb

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 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 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, 6170 queries

Test #80:

score: 0
Accepted
time: 153ms
memory: 3856kb

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
4
4
3
3
3
3
4
4
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 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 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, 6173 queries

Test #81:

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

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 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 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, 6176 queries

Test #82:

score: 0
Accepted
time: 142ms
memory: 3620kb

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 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 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, 6234 queries

Test #83:

score: 0
Accepted
time: 134ms
memory: 3680kb

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
4
4
3
3
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
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 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 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, 6174 queries

Test #84:

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

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 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 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, 6175 queries

Test #85:

score: 0
Accepted
time: 118ms
memory: 3628kb

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 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 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, 6194 queries

Test #86:

score: 0
Accepted
time: 145ms
memory: 3620kb

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 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 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, 6149 queries

Test #87:

score: 0
Accepted
time: 141ms
memory: 3724kb

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 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 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, 6171 queries

Test #88:

score: 0
Accepted
time: 155ms
memory: 3676kb

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 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 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, 6197 queries

Test #89:

score: 0
Accepted
time: 149ms
memory: 3632kb

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 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 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, 6153 queries

Test #90:

score: 0
Accepted
time: 161ms
memory: 3676kb

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
4
4
3
3
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
...

output:

? 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 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, 6148 queries

Test #91:

score: 0
Accepted
time: 140ms
memory: 3632kb

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 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 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, 6198 queries

Test #92:

score: 0
Accepted
time: 123ms
memory: 3572kb

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 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 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, 6154 queries

Test #93:

score: 0
Accepted
time: 175ms
memory: 3624kb

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
2
2
1
1
1
1
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
...

output:

? 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 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, 6158 queries

Test #94:

score: 0
Accepted
time: 170ms
memory: 3856kb

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 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 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, 6184 queries

Test #95:

score: 0
Accepted
time: 137ms
memory: 3672kb

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 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 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, 6209 queries

Test #96:

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

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
3
3
2
2
2
2
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
3
3
3
3
3
2
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 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 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, 6161 queries

Test #97:

score: 0
Accepted
time: 137ms
memory: 3852kb

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
4
4
3
3
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
3
3
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 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 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, 6177 queries

Test #98:

score: 0
Accepted
time: 137ms
memory: 3680kb

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 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 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, 6157 queries

Test #99:

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

input:

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

output:

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

result:

ok n=5, 16 queries

Test #100:

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

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 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 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, 6164 queries

Test #101:

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

input:

4
1
1
2
1
1
2
2
3
2

output:

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

result:

ok n=4, 9 queries

Test #102:

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

input:

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

output:

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

result:

ok n=5, 16 queries

Test #103:

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

input:

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

output:

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

result:

ok n=6, 20 queries

Test #104:

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

input:

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

output:

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

result:

ok n=7, 26 queries

Test #105:

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

input:

4
1
2
2
3
2
2
0
1
2

output:

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

result:

ok n=4, 9 queries

Test #106:

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

input:

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

output:

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

result:

ok n=5, 14 queries

Test #107:

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

input:

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

output:

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

result:

ok n=6, 23 queries

Test #108:

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

input:

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

output:

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

result:

ok n=7, 30 queries

Test #109:

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

input:

4
1
2
2
3
2
2
0
1
2

output:

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

result:

ok n=4, 9 queries

Test #110:

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

input:

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

output:

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

result:

ok n=5, 14 queries

Test #111:

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

input:

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

output:

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

result:

ok n=6, 23 queries

Test #112:

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

input:

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

output:

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

result:

ok n=7, 30 queries

Test #113:

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

input:

4
2
1
1
0
1
1
3
2
1

output:

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

result:

ok n=4, 9 queries

Test #114:

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

input:

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

output:

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

result:

ok n=5, 16 queries

Test #115:

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

input:

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

output:

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

result:

ok n=6, 22 queries

Test #116:

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

input:

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

output:

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

result:

ok n=7, 30 queries

Test #117:

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

input:

4
1
2
2
2
3
2
1
1
2

output:

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

result:

ok n=4, 9 queries

Test #118:

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

input:

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

output:

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

result:

ok n=5, 14 queries

Test #119:

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

input:

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

output:

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

result:

ok n=6, 20 queries

Test #120:

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

input:

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

output:

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

result:

ok n=7, 30 queries

Test #121:

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

input:

4
1
2
2
2
3
2
1
1
2

output:

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

result:

ok n=4, 9 queries

Test #122:

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

input:

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

output:

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

result:

ok n=5, 15 queries

Test #123:

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

input:

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

output:

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

result:

ok n=6, 22 queries

Test #124:

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

input:

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

output:

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

result:

ok n=7, 29 queries

Test #125:

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

input:

4
2
1
1
1
0
1
2
2
1

output:

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

result:

ok n=4, 9 queries

Test #126:

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

input:

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

output:

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

result:

ok n=5, 15 queries

Test #127:

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

input:

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

output:

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

result:

ok n=6, 22 queries

Test #128:

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

input:

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

output:

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

result:

ok n=7, 32 queries

Test #129:

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

input:

4
1
1
2
1
1
2
2
3
2

output:

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

result:

ok n=4, 9 queries

Test #130:

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

input:

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

output:

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

result:

ok n=5, 14 queries

Test #131:

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

input:

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

output:

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

result:

ok n=6, 22 queries

Test #132:

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

input:

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

output:

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

result:

ok n=7, 28 queries

Test #133:

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

input:

4
2
2
0
1
1
1
2
1
0

output:

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

result:

ok n=4, 9 queries

Test #134:

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

input:

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

output:

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

result:

ok n=5, 15 queries

Test #135:

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

input:

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

output:

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

result:

ok n=6, 22 queries

Test #136:

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

input:

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

output:

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

result:

ok n=7, 29 queries

Test #137:

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

input:

4
2
2
0
1
1
1
2
1
0

output:

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

result:

ok n=4, 9 queries

Test #138:

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

input:

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

output:

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

result:

ok n=5, 15 queries

Test #139:

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

input:

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

output:

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

result:

ok n=6, 21 queries

Test #140:

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

input:

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

output:

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

result:

ok n=7, 33 queries

Test #141:

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

input:

4
1
0
2
1
1
2
2
2
2

output:

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

result:

ok n=4, 9 queries

Test #142:

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

input:

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

output:

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

result:

ok n=5, 14 queries

Test #143:

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

input:

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

output:

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

result:

ok n=6, 22 queries

Test #144:

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

input:

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

output:

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

result:

ok n=7, 27 queries