QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#109710#4218. Hidden GraphzhoukangyangAC ✓225ms10044kbC++171.4kb2023-05-30 14:03:302023-05-30 14:03:33

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-30 14:03:33]
  • 评测
  • 测评结果:AC
  • 用时:225ms
  • 内存:10044kb
  • [2023-05-30 14:03:30]
  • 提交

answer

#include<bits/stdc++.h>
#define L(i, j, k) for(int i = (j); i <= (k); ++i)
#define R(i, j, k) for(int i = (j); i >= (k); --i)
#define ll long long
#define sz(a) ((int) (a).size())
#define vi vector < int > 
#define me(a, x) memset(a, x, sizeof(a))
#define ull unsigned long long
#define ld __float128
using namespace std;
const int N = 2007;
int n;
int vis[N][N];
bool ask(vi &cur) {
	cout << "? " << sz(cur) << ' ';
	for(auto &t : cur) cout << t << ' ';
	cout << endl;
	int x, y;
	cin >> x >> y;
	if(x == -1) return 0;
	vis[x][y] = vis[y][x] = 1;
	return 1;
}
int inq[N];
void solve(vi S) {
	if(!sz(S)) return ; 
	int u = S[0];
	vi cur = {u};
	for(auto &x : S) if(x != u) {
		cur.emplace_back(x);
		if(ask(cur)) cur.pop_back();
	}
	for(auto &p : S) inq[p] = 1;
	for(auto &u : cur) inq[u] = 0;
	vi ncur;
	for(auto &p : S) if(inq[p]) {
		ncur.emplace_back(p);
		while(true) {
			vi np = vi{p};
			for(auto &k : cur) 
				if(!vis[p][k]) 
					np.emplace_back(k);
			if(sz(np) == 1 || !ask(np)) {
				break;
			}
		}
	}
	solve(ncur);
}
int main() {
	ios :: sync_with_stdio(false); 
	cin.tie(0); cout.tie(0);
	cin >> n;
	vi S;
	L(i, 1, n) S.emplace_back(i);
	solve(S); 
	int ans = 0;
	L(i, 1, n) L(j, i + 1, n) if(vis[i][j]) ++ans;
	cout << "! " << ans << '\n';
	L(i, 1, n) L(j, i + 1, n) if(vis[i][j]) cout << i << ' ' << j << '\n';
	cout << endl;
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
1 2
1 3
2 3

output:

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


result:

ok correct

Test #2:

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

input:

10
1 2
1 3
1 4
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
2 5
2 6
-1 -1
3 7
3 10
3 8
3 9
-1 -1
4 8
4 10
4 5
-1 -1
-1 -1
-1 -1

output:

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

result:

ok correct

Test #3:

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

input:

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

output:

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


result:

ok correct

Test #4:

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

input:

3
2 1
1 3
-1 -1

output:

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


result:

ok correct

Test #5:

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

input:

6
1 2
3 1
-1 -1
4 5
-1 -1
4 2
-1 -1
3 6
3 4
-1 -1
3 2
2 5
3 5

output:

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


result:

ok correct

Test #6:

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

input:

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

output:

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

result:

ok correct

Test #7:

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

input:

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

output:

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

result:

ok correct

Test #8:

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

input:

38
-1 -1
-1 -1
4 1
1 5
-1 -1
2 7
-1 -1
-1 -1
-1 -1
11 1
12 8
13 1
6 14
-1 -1
16 6
2 17
3 18
-1 -1
15 20
8 21
15 22
19 23
24 1
2 25
26 19
15 27
28 8
29 3
-1 -1
31 19
15 32
33 9
30 34
8 35
-1 -1
37 6
38 2
4 19
4 6
4 10
-1 -1
36 5
3 5
-1 -1
6 7
-1 -1
-1 -1
-1 -1
13 8
-1 -1
1 14
3 14
19 14
-1 -1
16 19
-...

output:

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

result:

ok correct

Test #9:

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

input:

25
-1 -1
-1 -1
-1 -1
5 4
6 4
7 3
2 8
9 4
10 3
2 11
12 4
-1 -1
14 13
-1 -1
16 3
4 17
18 4
13 19
20 13
13 21
4 22
-1 -1
24 15
25 3
5 2
5 13
-1 -1
6 13
-1 -1
7 13
-1 -1
8 23
4 8
13 8
-1 -1
2 9
-1 -1
10 15
-1 -1
-1 -1
-1 -1
14 4
14 3
-1 -1
16 13
-1 -1
-1 -1
18 13
18 2
-1 -1
-1 -1
20 23
20 3
-1 -1
-1 -1
...

output:

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

result:

ok correct

Test #10:

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

input:

6
-1 -1
2 3
-1 -1
2 5
-1 -1
-1 -1
5 6
-1 -1
-1 -1

output:

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


result:

ok correct

Test #11:

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

input:

3
2 1
3 1
2 3

output:

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


result:

ok correct

Test #12:

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

input:

3
2 1
3 1
-1 -1

output:

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


result:

ok correct

Test #13:

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

input:

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

output:

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


result:

ok correct

Test #14:

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

input:

3
2 1
-1 -1
-1 -1

output:

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


result:

ok correct

Test #15:

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

input:

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

output:

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


result:

ok correct

Test #16:

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

input:

93
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
10 9
7 11
2 12
5 13
-1 -1
-1 -1
6 16
-1 -1
-1 -1
19 18
-1 -1
-1 -1
-1 -1
8 23
-1 -1
1 25
20 26
-1 -1
-1 -1
1 29
4 30
31 9
32 27
28 33
34 9
-1 -1
36 2
35 37
27 38
2 39
40 35
1 41
21 42
5 43
44 4
-1 -1
-1 -1
5 47
-1 -1
49 45
14 50
51 9
5 52
53 15
-1 -...

output:

? 2 1 2 
? 3 1 2 3 
? 4 1 2 3 4 
? 5 1 2 3 4 5 
? 6 1 2 3 4 5 6 
? 7 1 2 3 4 5 6 7 
? 8 1 2 3 4 5 6 7 8 
? 9 1 2 3 4 5 6 7 8 9 
? 10 1 2 3 4 5 6 7 8 9 10 
? 10 1 2 3 4 5 6 7 8 9 11 
? 10 1 2 3 4 5 6 7 8 9 12 
? 10 1 2 3 4 5 6 7 8 9 13 
? 10 1 2 3 4 5 6 7 8 9 14 
? 11 1 2 3 4 5 6 7 8 9 14 15 
? 12 1 ...

result:

ok correct

Test #17:

score: 0
Accepted
time: 11ms
memory: 3864kb

input:

111
-1 -1
-1 -1
-1 -1
-1 -1
2 6
7 4
3 8
-1 -1
-1 -1
2 11
12 4
13 10
-1 -1
-1 -1
-1 -1
17 10
18 5
16 19
-1 -1
4 21
-1 -1
-1 -1
-1 -1
-1 -1
26 10
-1 -1
2 28
16 29
25 30
27 31
-1 -1
-1 -1
10 34
-1 -1
27 36
37 4
38 15
39 1
-1 -1
27 41
42 4
25 43
44 27
27 45
2 46
47 16
48 35
49 15
-1 -1
-1 -1
-1 -1
-1 -1...

output:

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

result:

ok correct

Test #18:

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

input:

132
-1 -1
3 1
-1 -1
5 1
-1 -1
7 2
-1 -1
-1 -1
10 8
-1 -1
12 8
9 13
2 14
-1 -1
-1 -1
17 15
-1 -1
19 6
-1 -1
21 20
22 8
-1 -1
24 9
-1 -1
-1 -1
-1 -1
28 15
-1 -1
4 30
6 31
4 32
-1 -1
-1 -1
26 35
36 9
-1 -1
38 29
6 39
29 40
-1 -1
42 15
43 9
26 44
45 20
-1 -1
47 29
4 48
49 1
-1 -1
51 50
-1 -1
53 9
54 1
5...

output:

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

result:

ok correct

Test #19:

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

input:

94
-1 -1
3 2
-1 -1
-1 -1
-1 -1
2 7
-1 -1
2 9
-1 -1
11 6
-1 -1
6 13
14 10
-1 -1
15 16
17 8
-1 -1
19 12
6 20
15 21
5 22
-1 -1
24 5
-1 -1
-1 -1
27 25
2 28
-1 -1
-1 -1
31 23
25 32
33 12
25 34
35 26
-1 -1
2 37
38 26
39 12
-1 -1
41 12
15 42
43 40
44 12
18 45
-1 -1
47 5
-1 -1
25 49
50 12
51 26
52 5
53 40
5...

output:

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

result:

ok correct

Test #20:

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

input:

73
-1 -1
1 3
-1 -1
-1 -1
-1 -1
5 7
-1 -1
1 9
1 10
4 11
-1 -1
13 6
-1 -1
15 8
1 16
17 4
-1 -1
1 19
20 14
4 21
12 22
23 5
-1 -1
1 25
-1 -1
-1 -1
28 2
1 29
30 26
31 8
-1 -1
33 32
1 34
12 35
12 36
-1 -1
38 14
12 39
1 40
-1 -1
4 42
6 43
44 5
14 45
-1 -1
-1 -1
12 48
12 49
50 18
51 4
52 26
1 53
-1 -1
1 55
...

output:

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

result:

ok correct

Test #21:

score: 0
Accepted
time: 11ms
memory: 3792kb

input:

77
-1 -1
3 2
2 4
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
1 11
-1 -1
8 13
14 7
2 15
16 1
7 17
-1 -1
-1 -1
2 20
8 21
22 19
7 23
18 24
-1 -1
-1 -1
-1 -1
2 28
-1 -1
18 30
6 31
32 6
18 33
34 25
2 35
7 36
37 5
-1 -1
7 39
40 25
41 27
-1 -1
-1 -1
44 43
8 45
18 46
47 5
-1 -1
-1 -1
50 10
2 51
52 7
-1 -1
6 54
-1 -...

output:

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

result:

ok correct

Test #22:

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

input:

81
-1 -1
2 3
2 4
1 5
-1 -1
-1 -1
1 8
-1 -1
10 6
-1 -1
6 12
-1 -1
1 14
13 15
11 16
6 17
18 6
19 7
20 11
6 21
2 22
11 23
1 24
-1 -1
25 26
25 27
28 6
6 29
-1 -1
-1 -1
-1 -1
-1 -1
25 34
30 35
36 6
1 37
-1 -1
-1 -1
-1 -1
2 41
42 33
30 43
2 44
25 45
46 40
2 47
48 6
49 31
50 6
6 51
52 25
6 53
2 54
40 55
11...

output:

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

result:

ok correct

Test #23:

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

input:

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

output:

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

result:

ok correct

Test #24:

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

input:

37
-1 -1
3 1
-1 -1
2 5
-1 -1
2 7
4 8
2 9
1 10
2 11
12 1
6 13
6 14
1 15
4 16
1 17
1 18
-1 -1
6 20
6 21
-1 -1
19 23
2 24
2 25
2 26
6 27
6 28
4 29
30 1
1 31
32 1
-1 -1
22 34
35 1
36 19
19 37
3 19
-1 -1
-1 -1
7 19
7 1
-1 -1
33 8
6 8
22 8
1 8
2 8
-1 -1
6 9
9 1
-1 -1
33 10
-1 -1
33 11
11 1
4 11
-1 -1
-1 -...

output:

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

result:

ok correct

Test #25:

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

input:

144
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
9 15
-1 -1
-1 -1
14 18
-1 -1
-1 -1
-1 -1
5 22
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
35 33
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
43 5
-1 -1
32 45
-1 -1
-1 -1
-1 -1
-1 -1
3 50
-1 -1
...

output:

? 2 1 2 
? 3 1 2 3 
? 4 1 2 3 4 
? 5 1 2 3 4 5 
? 6 1 2 3 4 5 6 
? 7 1 2 3 4 5 6 7 
? 8 1 2 3 4 5 6 7 8 
? 9 1 2 3 4 5 6 7 8 9 
? 10 1 2 3 4 5 6 7 8 9 10 
? 11 1 2 3 4 5 6 7 8 9 10 11 
? 12 1 2 3 4 5 6 7 8 9 10 11 12 
? 13 1 2 3 4 5 6 7 8 9 10 11 12 13 
? 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 
? 15 1 ...

result:

ok correct

Test #26:

score: 0
Accepted
time: 27ms
memory: 6040kb

input:

561
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
26 22
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
46 31
37 47
39 48
-1 -1
-1 -1
-1...

output:

? 2 1 2 
? 3 1 2 3 
? 4 1 2 3 4 
? 5 1 2 3 4 5 
? 6 1 2 3 4 5 6 
? 7 1 2 3 4 5 6 7 
? 8 1 2 3 4 5 6 7 8 
? 9 1 2 3 4 5 6 7 8 9 
? 10 1 2 3 4 5 6 7 8 9 10 
? 11 1 2 3 4 5 6 7 8 9 10 11 
? 12 1 2 3 4 5 6 7 8 9 10 11 12 
? 13 1 2 3 4 5 6 7 8 9 10 11 12 13 
? 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 
? 15 1 ...

result:

ok correct

Test #27:

score: 0
Accepted
time: 38ms
memory: 6168kb

input:

679
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
39 40
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
46 14
-1 -1
-1 -1
-1 -1
-1 -1
-1...

output:

? 2 1 2 
? 3 1 2 3 
? 4 1 2 3 4 
? 5 1 2 3 4 5 
? 6 1 2 3 4 5 6 
? 7 1 2 3 4 5 6 7 
? 8 1 2 3 4 5 6 7 8 
? 9 1 2 3 4 5 6 7 8 9 
? 10 1 2 3 4 5 6 7 8 9 10 
? 11 1 2 3 4 5 6 7 8 9 10 11 
? 12 1 2 3 4 5 6 7 8 9 10 11 12 
? 13 1 2 3 4 5 6 7 8 9 10 11 12 13 
? 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 
? 15 1 ...

result:

ok correct

Test #28:

score: 0
Accepted
time: 78ms
memory: 7984kb

input:

1000
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
17 27
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
18 45
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-...

output:

? 2 1 2 
? 3 1 2 3 
? 4 1 2 3 4 
? 5 1 2 3 4 5 
? 6 1 2 3 4 5 6 
? 7 1 2 3 4 5 6 7 
? 8 1 2 3 4 5 6 7 8 
? 9 1 2 3 4 5 6 7 8 9 
? 10 1 2 3 4 5 6 7 8 9 10 
? 11 1 2 3 4 5 6 7 8 9 10 11 
? 12 1 2 3 4 5 6 7 8 9 10 11 12 
? 13 1 2 3 4 5 6 7 8 9 10 11 12 13 
? 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 
? 15 1 ...

result:

ok correct

Test #29:

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

input:

1000
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
13 14
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
6 22
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
43 24
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1...

output:

? 2 1 2 
? 3 1 2 3 
? 4 1 2 3 4 
? 5 1 2 3 4 5 
? 6 1 2 3 4 5 6 
? 7 1 2 3 4 5 6 7 
? 8 1 2 3 4 5 6 7 8 
? 9 1 2 3 4 5 6 7 8 9 
? 10 1 2 3 4 5 6 7 8 9 10 
? 11 1 2 3 4 5 6 7 8 9 10 11 
? 12 1 2 3 4 5 6 7 8 9 10 11 12 
? 13 1 2 3 4 5 6 7 8 9 10 11 12 13 
? 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 
? 14 1 ...

result:

ok correct

Test #30:

score: 0
Accepted
time: 225ms
memory: 10044kb

input:

2000
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
44 15
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-...

output:

? 2 1 2 
? 3 1 2 3 
? 4 1 2 3 4 
? 5 1 2 3 4 5 
? 6 1 2 3 4 5 6 
? 7 1 2 3 4 5 6 7 
? 8 1 2 3 4 5 6 7 8 
? 9 1 2 3 4 5 6 7 8 9 
? 10 1 2 3 4 5 6 7 8 9 10 
? 11 1 2 3 4 5 6 7 8 9 10 11 
? 12 1 2 3 4 5 6 7 8 9 10 11 12 
? 13 1 2 3 4 5 6 7 8 9 10 11 12 13 
? 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 
? 15 1 ...

result:

ok correct