QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#401855#7418. Interactive Vertexjames1BadCreeper#AC ✓279ms32104kbC++142.0kb2024-04-29 15:50:002024-04-29 15:50:00

Judging History

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

  • [2024-04-29 15:50:00]
  • 评测
  • 测评结果:AC
  • 用时:279ms
  • 内存:32104kb
  • [2024-04-29 15:50:00]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5; 

int n, ans = -1; 
vector<int> G[N]; 
bool vis[N]; 
int sz[N], mxs[N], rt; 

int ask(int x, vector<int> v) {
    cout << "? " << v.size() << ' ' << x << ' '; 
    for (int i : v) cout << i << ' '; 
    cout << endl; cin >> x; 
    return x; 
}

void froot(int x, int fa, int tot) {
    sz[x] = 1; mxs[x] = 0; 
    for (int y : G[x]) if (y != fa && !vis[y])
        froot(y, x, tot), sz[x] += sz[y], mxs[x] = max(mxs[x], sz[y]); 
    mxs[x] = max(mxs[x], tot - sz[x]); 
    if (mxs[rt] > mxs[x]) rt = x; 
}

void solve(int x) {
    if (ans != -1) return; 
    vector<int> vec; 
    for (int y : G[x]) if (!vis[y]) vec.emplace_back(y); 
    if (vec.empty()) return ans = x, void(); 
    if (ask(x, vec) == 1) return ans = x, void(); 
    sort(vec.begin(), vec.end(), [&](int u, int v){ return sz[u] < sz[v]; }); 
    vis[x] = 1; 
    int L = 0, R = vec.size() - 1; 
    while (L < R) {
        // int mid = L + R >> 1; // 3 4
        int alsz = 0; 
        for (int i = L; i <= R; ++i) alsz += sz[vec[i]]; 
        int mnv = 1e9, mid = -1, ds = 0; 
        for (int i = L; i <= R; ++i) {
            if (max(ds, alsz - ds) < mnv) mid = i - 1, mnv = max(ds, alsz - ds); 
            ds += sz[vec[i]]; 
        }
        vector<int> now; 
        for (int i = L; i <= mid; ++i) now.emplace_back(vec[i]); 
        if (ask(x, now) == 1) L = mid + 1; 
        else R = mid; 
        // cerr << L << " " << R << endl; 
    }
    int y = vec[L]; 
    // cerr << "FOUND " << y << endl; 
    int all = sz[y];  
    rt = 0; froot(y, 0, all); froot(rt, 0, all); 
    solve(rt); 
}

int main(void) {
    ios::sync_with_stdio(0); 
    cin >> n; 
    for (int i = 1; i < n; ++i) {
        int u, v; cin >> u >> v; 
        G[u].emplace_back(v); G[v].emplace_back(u); 
    }
    mxs[0] = 1e9; 
    int all = n; 
    froot(1, 0, all); froot(rt, 0, all); 
    solve(rt); 
    cout << "! " << ans << endl; 
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 3ms
memory: 8540kb

input:

5
1 2
1 3
1 4
1 5

1

output:

? 4 1 2 3 4 5 
! 1

result:

ok 1 queries

Test #2:

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

input:

5
1 2
1 3
1 4
1 5

0
0
0

output:

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

result:

ok 3 queries

Test #3:

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

input:

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

1

output:

? 3 3 2 4 6 
! 3

result:

ok 1 queries

Test #4:

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

input:

100
75 98
98 87
35 98
98 93
98 63
83 25
98 21
97 25
19 98
8 25
43 98
28 94
92 28
51 98
6 28
95 98
58 98
12 28
4 42
9 28
30 25
91 98
28 77
98 76
24 42
28 82
14 25
28 32
98 1
81 98
42 50
98 71
98 26
20 98
80 39
28 23
70 28
88 25
69 28
28 99
41 98
98 55
29 98
61 28
27 28
11 25
98 84
34 28
98 100
36 98
...

output:

? 51 98 75 87 35 93 63 21 19 43 51 95 58 91 76 1 81 71 26 20 41 55 29 84 100 36 79 15 85 56 45 48 52 62 28 78 46 96 64 59 18 2 89 68 90 65 31 66 13 54 17 40 73 
? 49 98 2 85 56 45 48 52 62 78 46 96 64 59 18 15 89 68 90 65 31 66 13 54 17 40 73 1 87 35 93 63 21 19 43 51 95 58 91 76 75 81 71 26 20 41 5...

result:

ok 14 queries

Test #5:

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

input:

203
139 160
172 95
170 39
106 39
3 95
6 39
130 16
148 65
62 160
109 39
39 69
23 16
95 84
39 11
95 37
36 39
95 103
60 39
94 39
39 35
39 123
138 39
199 39
5 16
65 160
142 16
77 39
135 39
97 39
39 72
95 92
39 44
65 200
65 129
39 152
39 176
16 86
16 95
39 143
198 39
95 90
39 17
197 39
89 16
95 189
16 47...

output:

? 102 39 170 106 6 109 69 11 36 60 94 35 123 138 199 77 135 97 72 44 152 176 143 198 17 197 178 127 78 102 180 157 191 38 91 192 114 185 25 122 113 28 24 131 64 147 54 46 184 43 95 57 196 169 79 161 175 203 51 12 154 136 73 190 158 121 179 159 10 19 112 58 171 59 120 63 98 88 66 68 188 145 124 83 12...

result:

ok 15 queries

Test #6:

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

input:

406
77 136
231 136
177 130
390 136
342 127
136 128
254 136
136 32
136 295
102 342
137 214
342 3
120 136
43 406
406 55
72 371
136 183
136 97
331 72
342 397
108 136
136 315
136 105
72 316
136 328
136 111
214 327
335 130
136 203
72 110
406 355
136 336
107 136
136 333
136 330
339 136
84 406
136 152
201 ...

output:

? 204 136 77 231 390 128 254 32 295 120 183 97 108 315 105 328 111 203 336 107 333 330 339 152 217 306 236 116 370 26 133 129 95 22 374 318 352 1 302 237 279 233 69 202 76 88 141 200 191 194 266 234 263 299 239 192 157 53 325 240 262 44 362 210 391 280 142 50 367 75 358 90 40 395 228 180 301 184 265...

result:

ok 19 queries

Test #7:

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

input:

812
72 362
362 196
362 743
244 362
20 111
362 455
229 64
362 756
143 362
534 20
158 362
312 20
157 362
362 731
323 20
20 742
20 439
64 451
64 89
363 235
239 64
549 362
454 362
686 20
123 54
217 20
362 514
30 362
362 208
565 64
362 577
362 764
593 64
293 362
265 499
54 156
362 105
54 190
362 249
64 4...

output:

? 407 362 72 196 743 244 455 756 143 158 157 731 549 454 514 30 208 577 764 293 105 249 118 102 495 216 624 763 778 142 484 349 37 684 301 800 212 243 274 266 680 364 134 285 322 744 174 388 372 230 339 83 638 359 385 463 347 750 66 555 173 544 512 508 260 513 148 419 492 115 93 309 469 8 594 56 220...

result:

ok 22 queries

Test #8:

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

input:

1625
1142 1405
1543 385
981 398
1176 385
123 385
385 252
385 1294
981 267
1552 385
385 23
1197 385
1016 385
536 385
385 769
385 858
385 178
412 981
1405 490
656 1290
385 1006
1076 385
205 981
762 981
1405 981
1434 981
385 692
1423 385
385 1463
981 121
1490 981
981 1563
981 550
172 385
1405 1408
1405...

output:

? 813 385 1543 1176 123 252 1294 1552 23 1197 1016 536 769 858 178 1006 1076 692 1423 1463 172 440 638 33 223 1115 1514 1139 1270 1594 399 1106 908 1374 639 1047 1285 1580 1138 357 1293 822 45 46 1190 1343 1324 155 1507 88 537 741 939 394 1560 845 227 261 1044 1392 461 1052 1384 140 548 309 193 1256...

result:

ok 24 queries

Test #9:

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

input:

3250
2887 101
1662 2017
629 1662
1662 1756
1692 2981
1662 3193
905 1692
2935 1692
2913 3047
1149 2887
461 1692
2403 1692
2509 721
1662 770
1662 1260
1662 824
1144 2509
2665 1692
1754 1662
1692 329
1367 1300
309 3047
1692 20
1109 1367
1692 1123
1662 705
1692 190
1692 2284
1857 1662
1692 305
1692 2893...

output:

? 1626 1662 2017 629 1756 3193 770 1260 824 1754 705 1857 1223 3020 825 1975 964 2542 2242 2464 2171 1672 927 108 1426 385 2203 107 2734 1073 2141 2941 1204 530 454 578 68 2664 2488 1640 237 1345 3135 2744 2890 3000 2806 2559 1293 858 1236 2595 391 118 1295 1395 608 3007 930 1607 463 2279 251 617 32...

result:

ok 27 queries

Test #10:

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

input:

7500
4955 6802
6802 2205
6287 3296
7002 6802
6802 5968
6802 4769
6802 1694
976 6802
5250 6802
6802 5281
2299 4676
297 2299
4317 2436
2299 3474
6802 6742
6802 1719
6802 4322
5849 2436
4036 6802
6802 3825
3888 319
994 4558
6802 4243
6880 6802
747 6802
2875 6802
1943 6802
6195 319
2436 1194
6802 1814
3...

output:

? 3751 6802 4955 2205 7002 5968 4769 1694 976 5250 5281 6742 1719 4322 4036 3825 4243 6880 747 2875 1943 1814 5706 3909 2750 3158 4063 6816 1869 3228 407 2790 6904 5702 6891 1206 2834 2380 4867 6429 5861 3656 6507 4203 3885 1411 4648 5588 1037 6698 2039 2708 3280 5289 5213 5008 2330 1947 3587 3117 1...

result:

ok 31 queries

Test #11:

score: 0
Accepted
time: 10ms
memory: 9044kb

input:

12500
12420 8595
5490 11605
5721 8595
5490 5512
11132 10795
7633 8595
7562 8595
8595 9744
8595 6080
11864 8595
9961 8595
1356 12167
2383 8595
6969 11132
2731 12093
1356 2780
9092 1356
12093 4567
7260 5490
12093 10751
5350 8595
2446 8595
5490 8866
8595 984
3002 8595
993 12093
2822 8595
2401 8595
181 ...

output:

? 6251 8595 12420 5721 7633 7562 9744 6080 11864 9961 2383 5350 2446 984 3002 2822 2401 181 8366 3670 9369 3804 5381 1724 3943 11063 12234 1613 10964 6650 4092 10714 3607 174 4598 7567 6987 2235 4154 9043 8128 2111 11785 359 10986 12339 775 2397 4212 10148 10607 6494 6718 7416 1092 1359 3191 1812 88...

result:

ok 33 queries

Test #12:

score: 0
Accepted
time: 10ms
memory: 10892kb

input:

25000
17077 20165
20161 18419
19850 19707
20165 14994
24206 20165
20165 20706
20165 21119
20165 4987
11925 11458
3554 20165
9374 3565
20165 17577
10268 23667
20165 11078
967 18419
23667 13186
20165 11382
17068 20165
14164 20165
14441 18419
18419 14530
3234 20165
21965 20165
23667 465
18419 5143
1327...

output:

? 12501 20165 17077 14994 24206 20706 21119 4987 3554 17577 11078 11382 17068 14164 3234 21965 13272 2493 7169 16124 6148 13752 16553 2172 470 13475 17501 16790 1396 8297 18100 12575 8155 3127 23501 12500 19929 17471 21846 1190 8737 11502 12239 5148 22265 16841 1130 14518 13620 9856 2204 23226 10969...

result:

ok 35 queries

Test #13:

score: 0
Accepted
time: 37ms
memory: 11548kb

input:

50000
18500 2466
18500 44110
11984 21015
41859 28173
30313 18500
41859 42387
24167 11984
18500 21584
37467 18500
19205 41859
3769 39568
44621 18500
18500 15381
11984 3214
39568 22324
39568 10564
11984 37444
8695 18500
11984 48894
28515 15353
12825 18500
7158 13866
20511 11984
24205 11984
18500 35929...

output:

? 25001 18500 2466 44110 30313 21584 37467 44621 15381 8695 12825 35929 48944 8581 25790 16372 1701 26402 961 48620 41746 11631 42899 14953 34731 24195 44163 34583 1777 4954 18902 45194 48116 47636 15900 18189 32989 9201 18648 42984 21846 20568 29585 25097 40593 11049 340 5615 48651 7225 4702 36904 ...

result:

ok 38 queries

Test #14:

score: 0
Accepted
time: 71ms
memory: 13460kb

input:

100000
41120 8939
59419 41120
56449 26963
40366 56449
56449 70598
32292 56449
56449 89841
56449 56997
12053 13650
76004 13650
64459 13650
39862 56449
19569 54227
9962 41120
19674 41120
13650 96450
66249 56449
56449 99458
14161 41120
65792 54227
41120 19819
94320 56449
88929 53412
73981 87237
56449 9...

output:

? 50001 56449 26963 40366 70598 32292 89841 56997 39862 66249 99458 94320 95897 91632 43 12331 18769 13507 71077 14317 50294 76086 12434 14606 91584 45862 86555 54272 48836 74152 15575 8487 99364 29810 13749 39711 69266 67157 66756 78936 36175 84420 68543 96731 66437 9479 91600 78953 32396 26180 537...

result:

ok 40 queries

Test #15:

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

input:

200000
67373 91995
10837 70900
70900 126177
91374 142953
141503 70900
58548 70900
9166 148393
69224 38404
79354 91995
70900 56066
194973 70900
5518 91995
70900 182408
17263 91995
91995 121231
70900 8680
99217 70900
81751 70900
40875 69224
96046 91995
150741 91995
60408 70900
91995 166066
131632 9199...

output:

? 100001 70900 10837 126177 141503 58548 56066 194973 182408 8680 99217 81751 60408 165106 37734 61920 187809 24647 87669 188124 186417 182099 78197 10556 191943 99201 189367 109018 27053 40563 35618 3002 1041 13548 78246 144706 115696 194072 186498 185831 47397 153360 73038 159137 141011 97977 1335...

result:

ok 43 queries

Test #16:

score: 0
Accepted
time: 130ms
memory: 17920kb

input:

200000
189756 112654
114148 160650
32649 112654
84423 160650
86820 112654
112654 63925
112654 67025
112654 56759
101542 112654
162907 157591
112654 4322
137371 84481
84131 112654
196940 123030
130323 112654
54890 112654
157450 160650
112654 10932
129671 196940
112654 128914
196940 104405
114481 1606...

output:

? 100001 112654 189756 32649 86820 63925 67025 56759 101542 4322 84131 130323 54890 10932 128914 72186 81937 99654 141762 108373 147199 104611 183289 60327 181769 119466 107099 129485 162096 132728 140052 87810 152064 94856 186881 155423 73895 114827 114108 43041 63147 133814 132819 134900 172741 82...

result:

ok 18 queries

Test #17:

score: 0
Accepted
time: 143ms
memory: 17444kb

input:

200000
194800 126799
118542 15648
2384 192813
118542 153032
118542 66351
2947 118542
119976 61565
183169 2384
2384 7689
2384 129177
42998 61565
77645 199693
144046 77645
124137 118542
77645 50935
136172 118542
118542 128308
123177 77645
101420 143193
129460 118542
2384 92688
92644 118542
61565 42515...

output:

? 44446 61565 119976 42998 42515 66671 28897 135828 63686 119100 142492 81361 102294 43404 120974 111192 50648 87503 9570 74678 41308 144569 67108 81054 6930 96265 34024 61879 97508 594 167371 92625 124024 16760 99921 149287 166182 165309 96376 90248 36426 11950 186994 160748 124330 174503 190098 63...

result:

ok 29 queries

Test #18:

score: 0
Accepted
time: 119ms
memory: 17108kb

input:

200000
60041 170200
166355 92021
197699 40677
192825 197699
97740 197699
12951 197699
197699 111438
60041 61019
147478 138403
12212 197699
197699 95531
183050 92021
14148 197699
122228 197699
89090 197699
197699 183179
197699 56002
92021 54420
92021 148459
38271 197699
163326 197699
197699 17939
945...

output:

? 44446 92021 166355 183050 54420 148459 94593 22190 117447 157647 65341 47562 44385 58598 6466 65482 160688 68692 106547 197648 170716 134993 96586 47335 176534 75156 16182 153492 151874 38350 190918 71400 128036 22456 176155 162763 48000 195970 69576 27480 150381 174152 176395 21453 148308 133507 ...

result:

ok 19 queries

Test #19:

score: 0
Accepted
time: 143ms
memory: 16836kb

input:

200000
19337 99274
83182 3228
35885 101792
63267 140995
77632 48159
122644 117878
48159 114799
172086 117878
60088 117878
19337 63450
63267 191350
53815 71028
108298 19337
13278 131936
159127 1966
107627 117878
34777 130206
54829 139331
63267 32864
7541 54829
44839 34777
34777 54838
34777 9400
63267...

output:

? 28127 54829 139331 7541 135698 175555 25666 116834 151607 110748 73087 141511 5076 38748 23892 175256 57571 45319 114474 67213 133217 83214 18214 81790 180410 132369 18590 111552 42789 52683 156557 31694 175009 187410 132168 4793 31601 160340 102314 19644 86668 186855 21670 23367 108680 87746 1062...

result:

ok 36 queries

Test #20:

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

input:

200000
155704 57519
61288 66259
66259 139972
32838 147826
194796 66259
106539 57519
74265 66259
46030 66259
91299 57519
124893 169916
124893 159491
57519 69366
171875 147826
147797 182493
68543 147826
182627 62375
13669 196471
25202 147797
87119 147826
124893 52039
10818 57519
147826 49003
147826 39...

output:

? 28127 57519 155704 106539 91299 69366 10818 11359 1652 105333 189694 97627 189224 159964 100387 65310 152741 28856 50869 40127 64149 26140 45231 69140 7969 181904 5357 69143 10671 166680 20591 129547 103468 103881 38441 186798 15807 149780 148092 120430 127029 9334 174918 138547 60167 23670 160291...

result:

ok 21 queries

Test #21:

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

input:

200000
35696 98797
25396 141756
16026 81023
121640 16889
141756 157830
176446 36397
48084 191893
165525 121640
191893 26747
141756 184606
37052 152271
166066 191893
141756 36365
141756 122815
118098 191893
84899 191893
74986 16026
135759 21172
186934 141756
20588 36397
191893 189184
152271 90325
767...

output:

? 20482 35696 98797 60283 131479 17343 30408 104518 15115 78770 143462 147343 89897 181533 95431 6982 183128 101540 155108 150067 49819 109112 159256 9510 35492 39799 73949 27023 17182 47098 88273 41743 16443 115283 36083 174387 119651 124595 41609 33713 137326 121795 166275 190304 33231 69353 15403...

result:

ok 34 queries

Test #22:

score: 0
Accepted
time: 135ms
memory: 17136kb

input:

200000
26015 4329
192563 116104
23299 179803
194423 23299
43985 192563
87997 10256
174277 4329
43532 45060
65068 96990
5201 171752
36807 184295
65068 92141
125074 36546
36807 179525
188908 46419
102488 4329
23299 129751
192563 97417
129066 23299
4329 161137
29190 65068
147518 192563
125074 127125
12...

output:

? 20482 125074 36546 127125 138519 107991 100686 45414 42301 7566 54439 36338 158511 38745 100979 69038 156328 123240 53097 14439 57166 118941 90344 140854 137768 152134 85129 49889 37879 179854 4887 52475 118992 44432 185669 181321 155064 77964 106882 51449 104111 14284 62854 59603 90213 158374 110...

result:

ok 24 queries

Test #23:

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

input:

200000
125404 174796
112134 192769
175796 74880
174796 194528
34556 163257
83938 121529
195976 154687
131336 83938
2082 83938
115020 186022
83938 97243
83938 161435
182095 6060
195976 172661
131912 163257
112134 22460
138096 154986
195976 113815
174796 123055
186612 182221
163166 163257
174796 47456...

output:

? 19292 112134 192769 22460 67754 57319 169330 122066 145566 78059 139640 146859 157869 181061 123180 148327 141221 129354 91537 66649 144174 178904 70941 76027 55798 110259 198240 15652 109908 104306 32234 94481 159807 128536 65839 150228 102360 177961 129928 45194 186030 169175 163994 138607 74222...

result:

ok 33 queries

Test #24:

score: 0
Accepted
time: 135ms
memory: 17176kb

input:

200000
76405 125001
46973 170279
26674 134878
58484 173573
76403 119102
134878 159371
187106 51978
51978 18999
39030 173573
173573 28591
73185 51978
51978 121276
46973 121890
162647 99048
162647 196644
137708 125001
181089 109410
2094 134878
134878 22555
1146 109410
165339 19381
26744 134878
173573 ...

output:

? 19292 169820 185631 12344 170354 81213 127430 182161 134415 16371 98572 183399 134960 36327 137673 72058 1799 38243 56896 51175 37536 48978 138386 159385 128401 95485 163389 83383 92809 172609 79049 147097 145726 124131 5499 22589 13098 12949 36947 118459 112045 183129 12670 74117 136055 62981 130...

result:

ok 22 queries

Test #25:

score: 0
Accepted
time: 125ms
memory: 17052kb

input:

200000
186231 139021
172758 162370
57879 34567
195703 90199
74109 48797
42828 165009
57879 11303
162370 165877
124361 90199
120077 198622
18520 131572
106387 139021
169066 149986
61003 32475
105289 64037
42828 196294
61003 25185
5317 57144
18520 124310
151909 61003
111042 176414
124436 61003
57879 1...

output:

? 15424 18520 131572 124310 82285 104544 193466 106572 164746 133787 70814 71348 122954 29971 157778 139630 125274 352 124083 121898 125559 82555 48224 152386 83570 4751 165463 97965 91390 103596 125090 129149 19024 181206 13795 100250 155456 170649 161943 89488 38347 112456 52157 35425 80827 193881...

result:

ok 35 queries

Test #26:

score: 0
Accepted
time: 125ms
memory: 17000kb

input:

200000
80814 164073
64891 166374
136967 174971
184380 102688
64404 167505
184380 52209
188170 85085
114474 141570
198833 73962
14063 30445
188170 199744
109705 80814
184380 181161
188170 166713
40597 73962
820 17710
81900 38904
188170 57984
80814 761
114474 90976
114474 194553
186542 62588
81900 143...

output:

? 15424 188170 85085 199744 166713 57984 15128 127548 155280 101055 69763 156578 535 101952 73009 69643 93904 74723 150330 174367 37977 151207 105752 176472 183538 102955 17085 133939 139940 129769 104202 60737 27023 37784 28405 76838 142466 125350 139663 20815 90663 115416 129239 79354 149040 65890...

result:

ok 17 queries

Test #27:

score: 0
Accepted
time: 186ms
memory: 16292kb

input:

200000
197046 67880
12531 50788
27588 19015
109408 127935
121122 70801
65075 183232
139342 44501
143884 40265
100333 24782
63674 27794
89004 48471
111125 90426
169583 68605
82432 27411
198627 156465
134033 77907
55863 31258
90554 92832
116920 79948
85811 137954
190256 96785
120788 101491
178454 1938...

output:

? 3 64386 116486 61212 138489 
? 2 64386 61212 138489 
? 3 83788 82806 192793 27908 
? 2 83788 82806 27908 
? 3 89573 9353 192793 160166 
? 2 89573 192793 9353 
? 1 89573 192793 
? 2 9353 82152 152517 
? 1 9353 82152 
? 2 82152 196525 175913 
? 1 82152 196525 
? 2 175913 31189 121596 
? 1 175913 311...

result:

ok 33 queries

Test #28:

score: 0
Accepted
time: 159ms
memory: 16020kb

input:

200000
83622 13439
191079 145007
120119 94675
28341 29201
106985 151849
49621 94425
61929 1893
40348 114178
150671 80525
99459 173408
171848 75522
178265 70554
30225 29149
56442 26396
195378 61413
17430 19786
5091 130623
157130 109703
26170 13758
171225 170437
73673 173208
184581 73757
107828 197406...

output:

? 4 112191 137037 5668 92046 6288 
? 3 112191 137037 5668 92046 
? 4 57548 63519 6288 25901 171429 
? 2 57548 6288 63519 
? 1 57548 25901 
? 3 171429 151033 156822 42569 
? 1 171429 151033 
? 3 151033 140841 24488 126040 
? 1 151033 140841 
? 3 140841 116927 124782 104656 
? 1 140841 116927 
? 3 116...

result:

ok 26 queries

Test #29:

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

input:

200000
127567 89933
176324 185481
48322 183119
186212 95804
45486 66083
74403 171986
169711 108982
36609 91864
188770 62827
117221 178286
97571 71703
77339 6578
147559 146011
94615 55427
93434 88854
38645 115869
89478 74091
126072 102437
120657 176055
87031 121309
73602 148870
14009 119444
151402 14...

output:

? 3 22321 128975 168682 153928 
? 2 22321 128975 168682 
? 4 153928 87649 126402 32661 88152 
? 2 153928 87649 126402 
? 1 153928 32661 
? 4 32661 88321 9143 167891 191163 
? 2 32661 88321 9143 
? 1 32661 167891 
? 4 167891 173458 97768 141223 49829 
? 2 167891 173458 97768 
? 1 167891 141223 
? 4 1...

result:

ok 26 queries

Test #30:

score: 0
Accepted
time: 165ms
memory: 16644kb

input:

200000
92671 85165
134668 195374
154945 153546
106694 149297
32191 93724
152101 148090
57807 128338
162983 120167
197113 8782
67904 37264
44213 153398
117170 135984
190934 24004
35870 184807
176864 63813
115137 127980
157838 30230
162694 43879
116288 195263
106869 153727
37769 100510
1809 144484
100...

output:

? 4 22762 155380 2892 96543 60312 
? 3 22762 155380 2892 60312 
? 5 96543 36121 128996 133473 47371 199141 
? 2 96543 36121 128996 
? 1 96543 133473 
? 5 133473 132784 152686 153293 91198 127560 
? 2 133473 132784 152686 
? 1 133473 153293 
? 5 153293 26329 56088 5541 182559 95637 
? 2 153293 26329 ...

result:

ok 25 queries

Test #31:

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

input:

200000
151870 113516
169128 171501
132091 16497
68353 27566
66749 28162
61437 47462
165924 91632
85143 71965
124631 112547
168503 39196
183523 21782
1843 193437
186 150586
111131 154453
118938 185343
3667 175225
94809 140111
166014 61232
189354 127782
57837 32618
34579 91506
102914 76736
90954 18611...

output:

? 5 18602 52191 175562 97530 163228 87883 
? 3 18602 175562 87883 52191 
? 2 18602 175562 87883 
? 1 18602 175562 
? 6 87883 84442 28988 67760 42158 194359 188957 
? 5 87883 84442 42158 194359 188957 28988 
? 4 87883 84442 42158 194359 188957 
? 2 87883 84442 42158 
? 1 87883 194359 
? 6 194359 1534...

result:

ok 23 queries

Test #32:

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

input:

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

output:

? 2 100001 100000 100002 
? 1 100001 100002 
? 2 50000 49999 50001 
? 1 50000 49999 
? 2 75001 75000 75002 
? 1 75001 75002 
? 2 87501 87500 87502 
? 1 87501 87500 
? 2 93751 93750 93752 
? 1 93751 93750 
? 2 90626 90625 90627 
? 1 90626 90625 
? 2 92189 92188 92190 
? 1 92189 92190 
? 2 92970 92969...

result:

ok 33 queries

Test #33:

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

input:

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

output:

? 3 2 1 3 4 
? 2 2 1 4 
? 1 2 1 
? 3 7 4 13 14 
? 2 7 13 14 
? 3 8 4 15 16 
? 2 8 4 16 
? 2 15 29 30 
? 1 15 29 
? 2 30 59 60 
? 1 30 59 
? 2 60 119 120 
? 1 60 119 
? 2 120 239 240 
? 1 120 239 
? 2 240 479 480 
? 1 240 479 
? 2 479 957 958 
? 1 479 957 
? 2 957 1913 1914 
? 1 957 1913 
? 2 1914 38...

result:

ok 33 queries

Test #34:

score: 0
Accepted
time: 48ms
memory: 23192kb

input:

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

output:

? 2 82768 82767 82769 
? 1 82768 82769 
? 3 100001 100000 100002 100003 
? 2 100001 100000 100003 
? 1 100001 100000 
? 2 91384 91383 91385 
? 1 91384 91383 
? 2 87076 87075 87077 
? 1 87076 87075 
? 2 89230 89229 89231 
? 1 89230 89229 
? 2 88153 88152 88154 
? 1 88153 88152 
? 2 88692 88691 88693 ...

result:

ok 28 queries

Test #35:

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

input:

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

output:

? 3 185 184 186 99867 
? 2 185 99867 184 
? 3 316 315 317 50087 
? 2 316 50087 315 
? 1 316 50087 
? 3 245 244 246 74937 
? 2 245 74937 244 
? 3 279 278 280 62408 
? 2 279 62408 280 
? 1 279 62408 
? 3 297 296 298 56243 
? 2 297 56243 296 
? 3 306 305 307 53282 
? 2 306 53282 305 
? 3 311 310 312 51...

result:

ok 32 queries

Test #36:

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

input:

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

output:

? 3 3 2 5 6 
? 2 3 5 6 
? 1 3 5 
? 2 6 11 12 
? 1 6 11 
? 2 12 23 24 
? 1 12 23 
? 2 23 45 46 
? 1 23 45 
? 2 46 91 92 
? 1 46 91 
? 2 91 181 182 
? 1 91 181 
? 2 13643 13642 13644 
? 1 13643 13644 
? 2 13707 13706 13708 
? 1 13707 13706 
? 2 13739 13738 13740 
? 1 13739 13738 
? 2 13755 13754 13756...

result:

ok 27 queries

Test #37:

score: 0
Accepted
time: 166ms
memory: 16216kb

input:

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

output:

? 3 2 1 3 6 
? 2 2 3 1 
? 1 2 3 
? 3 23 9 29 31 
? 2 23 31 29 
? 1 23 31 
? 3 80 29 113 161 
? 2 80 113 29 
? 1 80 113 
? 3 54 48 76 111 
? 2 54 48 76 
? 3 264 246 391 1041 
? 2 264 1041 391 
? 3 490 124 729 2365 
? 2 490 2365 124 
? 1 490 2365 
? 3 463 201 1199 1393 
? 2 463 1199 1393 
? 1 463 1199...

result:

ok 30 queries

Test #38:

score: 0
Accepted
time: 223ms
memory: 16440kb

input:

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

output:

? 3 19 14 23 28 
? 2 19 23 14 
? 1 19 23 
? 3 2 1 5 6 
? 2 2 6 1 
? 3 256 237 286 288 
? 2 256 286 237 
? 1 256 286 
? 3 1050 1020 1086 1103 
? 2 1050 1086 1103 
? 1 1050 1086 
? 3 5726 5603 5791 5836 
? 2 5726 5791 5603 
? 1 5726 5791 
? 3 10244 10080 10390 10428 
? 2 10244 10390 10080 
? 3 35223 3...

result:

ok 35 queries

Test #39:

score: 0
Accepted
time: 185ms
memory: 16584kb

input:

200000
89808 18186
166981 19346
129947 128984
89229 156428
105681 55781
168413 198744
30636 119382
191119 180690
93020 139411
178842 116481
20535 14619
123532 54764
73134 108532
152482 174467
126334 5833
115628 194162
149045 27149
109014 36060
65260 144471
183871 91280
32754 94320
114410 29180
11815...

output:

? 10 54891 148326 152368 41276 15524 36949 154300 31308 66563 49994 137189 
? 9 54891 137189 41276 154300 15524 152368 31308 36949 49994 66563 
? 8 54891 137189 41276 154300 15524 152368 31308 36949 49994 
? 11 91825 152780 179815 45592 26065 163714 96778 25161 134893 128572 199165 8139 
? 10 91825 ...

result:

ok 25 queries

Test #40:

score: 0
Accepted
time: 135ms
memory: 17064kb

input:

200000
192017 96151
216 18872
13640 36811
155055 44012
171789 134688
140272 85439
26433 194735
1234 93424
65977 4968
95820 16817
92368 162787
162522 48674
77026 78837
64838 82427
19114 139920
131671 73044
94130 54916
136660 86958
13153 35604
145515 146109
37573 62834
194506 58463
153188 29789
181252...

output:

? 100 155297 160641 11365 184301 179739 185513 83656 75003 84337 13587 85226 7746 81789 134544 40425 181885 130770 681 79577 138688 60296 162446 19413 73450 139199 122839 96559 36434 39869 190822 80644 197806 99236 59243 152851 139247 51862 190578 127888 28173 176686 148949 178360 111463 28427 19403...

result:

ok 23 queries

Test #41:

score: 0
Accepted
time: 217ms
memory: 16360kb

input:

200000
135313 140706
42520 31402
66453 137674
128253 75940
156350 79299
97114 51207
120732 112525
38133 84350
70965 59099
178484 44622
107936 39332
19004 47125
194563 349
139399 112892
141788 161513
164444 178062
31525 75155
170226 35063
13977 12068
28879 108184
86587 180591
82081 38630
18915 12042
...

output:

? 5 27138 82517 103429 8483 50249 7975 
? 4 27138 82517 8483 7975 103429 
? 3 38085 54653 89854 141848 
? 2 38085 54653 141848 
? 1 38085 54653 
? 4 127708 21957 84015 129118 122779 
? 3 127708 122779 129118 21957 
? 2 127708 122779 129118 
? 1 127708 122779 
? 3 120884 138787 13918 156956 
? 2 1208...

result:

ok 30 queries

Test #42:

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

input:

200000
13964 192594
104399 11921
158524 141369
142859 172204
136029 155075
18980 16157
85834 65427
167462 109817
120745 74795
122546 146066
94957 157012
84949 165666
114466 170644
148410 53111
65320 121249
84523 108631
22975 138906
77947 36001
116936 163414
17040 99951
178001 161956
182309 175195
51...

output:

? 835 52598 132009 195485 128140 44035 180618 30063 154233 186047 139901 135769 40110 50242 82969 144853 156599 178353 82106 42326 178575 14556 143163 29486 112933 1300 66662 126887 131959 7018 81866 14366 178677 138499 81194 143036 182309 148487 131705 144976 167254 98689 58614 22346 133277 172671 ...

result:

ok 20 queries

Test #43:

score: 0
Accepted
time: 218ms
memory: 16620kb

input:

200000
31082 95921
121062 61352
9535 49055
116561 156372
180581 37600
146586 96163
35101 3747
107151 130659
161070 173661
165716 52875
12957 2188
92142 20877
67538 111467
96718 5323
112344 10196
28019 195218
100750 77016
47845 64035
29447 190858
109322 192480
148558 87096
24052 42225
64671 126261
35...

output:

? 3 34681 46949 111368 142199 
? 2 34681 46949 142199 
? 4 22012 157533 149180 126326 74815 
? 3 22012 126326 157533 74815 
? 5 88373 180416 84976 77440 139429 28846 
? 4 88373 139429 180416 28846 77440 
? 3 88373 139429 180416 28846 
? 3 93314 128234 42351 55896 
? 2 93314 55896 42351 
? 4 187203 1...

result:

ok 30 queries

Test #44:

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

input:

200000
135781 33489
102955 106871
4916 6947
177470 65513
154952 142274
21956 157091
160290 24208
120634 185180
111578 144641
3722 82613
147079 51489
110565 154952
34683 137742
186077 104895
61298 19440
141904 94571
96737 167091
190538 186054
154252 187550
64426 48917
44249 90688
119488 40524
1684 19...

output:

? 5862 63285 123036 54741 55542 95435 75133 89564 5975 148177 137299 187522 45798 169942 71266 12349 125357 114170 149856 184612 114366 178344 28806 111389 15189 129376 7576 108389 34202 163505 150132 9646 152777 25812 197593 35507 50448 67048 42592 49211 159985 112003 59639 182349 67900 10176 72958...

result:

ok 19 queries

Test #45:

score: 0
Accepted
time: 219ms
memory: 16928kb

input:

200000
154193 193001
30156 122217
107725 140195
156932 145659
22178 55194
114273 27993
23124 27533
15823 128945
69179 64499
136842 40327
176690 192349
75825 74092
192349 37586
22350 164926
198899 80292
164564 5595
69089 181720
855 40828
180865 3782
24605 97247
76951 105626
196009 61928
110924 84260
...

output:

? 3 175600 62566 140315 139965 
? 2 175600 139965 140315 
? 1 175600 139965 
? 4 176593 88515 119442 144594 31323 
? 3 176593 119442 88515 144594 
? 3 89529 140168 187636 146003 
? 2 89529 140168 146003 
? 1 89529 140168 
? 3 96235 123966 155435 82225 
? 2 96235 123966 82225 
? 5 15304 143384 13989 ...

result:

ok 32 queries

Test #46:

score: 0
Accepted
time: 115ms
memory: 17392kb

input:

200000
116114 141841
102671 81714
601 12599
66910 162330
141841 179113
195210 145697
77553 90814
102101 141841
190254 9266
151423 168116
12477 102322
25033 21751
56455 83882
170868 161608
94541 170799
170715 56847
35739 170868
30518 58155
168430 14954
100436 25033
112350 170868
123312 34993
9266 134...

output:

? 13781 102322 12477 144169 52052 132083 96381 112017 187496 53734 87832 130371 69572 124699 49639 84529 166983 63550 132280 116789 13957 52837 75261 100958 93455 76196 67323 17557 153573 68629 56935 44406 154458 104615 167775 62541 64612 103962 29819 91434 144143 188733 178908 190723 192029 162131 ...

result:

ok 19 queries

Test #47:

score: 0
Accepted
time: 173ms
memory: 17068kb

input:

200000
197240 48346
17939 177600
187647 35711
69742 82050
97560 189767
156301 71086
178438 110122
41937 44356
16190 148624
132709 144345
176900 86991
122830 39907
166538 61323
82058 123892
63978 76605
142845 184698
59447 162944
78979 28995
147593 89522
130425 178797
168159 30001
8710 14260
114745 18...

output:

? 4 127868 162917 140796 12809 48657 
? 3 127868 12809 162917 140796 
? 2 127868 12809 162917 
? 1 127868 12809 
? 3 138609 68597 53743 194976 
? 2 138609 194976 68597 
? 4 16128 27826 144919 187351 188509 
? 3 16128 27826 144919 188509 
? 2 16128 27826 144919 
? 2 159476 83475 139001 
? 1 159476 83...

result:

ok 24 queries

Test #48:

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

input:

200000
177769 113131
112004 41495
32423 9146
122524 169667
31435 105146
39234 25313
152598 25313
137230 71860
131341 99076
138231 116559
192437 189408
45752 172912
164529 192437
138231 66138
13218 113131
141631 131341
122524 92392
196117 5417
113131 28766
51209 31435
25313 75725
25313 112190
31435 1...

output:

? 34576 31435 105146 51209 173958 107713 153593 44467 4078 88867 27746 178026 114975 111653 11846 99409 170394 2098 74418 113927 29824 56842 48971 69207 114549 90023 43769 59072 145885 107275 12991 32201 153389 135525 91637 132527 181955 60286 92644 40528 95093 116286 146764 174526 106764 59401 1560...

result:

ok 20 queries

Test #49:

score: 0
Accepted
time: 236ms
memory: 18716kb

input:

200000
111551 183636
129388 19707
50969 16509
78307 77063
38953 92928
45417 104114
66029 173787
68128 50801
41518 153416
165645 133134
59235 163233
149251 172444
153643 125513
181222 33644
140359 137209
49661 8703
12173 70802
136818 157101
23980 97043
98765 188215
174000 173869
156923 71995
114853 1...

output:

? 4 5092 142045 181177 7558 185975 
? 3 5092 181177 7558 185975 
? 3 66115 135274 23669 128076 
? 2 66115 23669 128076 
? 1 66115 23669 
? 3 30544 45914 10900 198654 
? 2 30544 45914 10900 
? 3 162967 195289 85511 584 
? 2 162967 584 195289 
? 3 123868 28685 132154 182540 
? 2 123868 132154 182540 
...

result:

ok 39 queries

Test #50:

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

input:

200000
82035 138408
70584 141939
182840 132073
96082 57614
57614 179564
150697 157274
63551 160432
132073 156620
87960 57614
132073 73453
57614 63779
66478 160980
86102 57614
172350 57614
174886 57614
84633 57614
9542 70584
3029 150697
49805 57614
161154 57614
132073 93452
70584 29439
70584 31734
70...

output:

? 96485 57614 96082 179564 87960 63779 86102 172350 174886 84633 49805 161154 70413 87762 182976 90792 105833 138598 162070 117030 80732 150557 175213 153046 193578 80067 77611 172931 199878 36255 42460 164382 173603 71087 77254 61665 159606 115140 160778 52847 186361 167094 37 7176 173345 8407 1242...

result:

ok 19 queries

Test #51:

score: 0
Accepted
time: 235ms
memory: 21520kb

input:

200000
40632 145379
38842 87449
64827 154992
72291 4302
196213 43035
127149 52651
196948 134757
177659 55543
25315 112602
49774 54330
146245 87900
33843 193072
174663 168879
146254 78058
111939 22874
148166 132639
150976 71842
198042 90209
140289 118512
76043 192793
121639 71578
138968 85036
182750 ...

output:

? 3 188471 8917 44450 172731 
? 2 188471 44450 172731 
? 1 188471 44450 
? 3 175138 122032 126103 9958 
? 2 175138 9958 122032 
? 3 54686 196634 188536 3299 
? 2 54686 188536 196634 
? 4 170047 148941 1465 189853 183188 
? 3 170047 189853 1465 183188 
? 3 14031 102228 134004 119555 
? 2 14031 119555...

result:

ok 35 queries

Test #52:

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

input:

200000
90093 183136
11971 90093
154922 90093
190851 90093
113632 177802
144751 113632
184215 90093
90093 117205
90093 195074
90093 23832
90093 115575
128903 90093
117294 113632
23786 79446
69283 90093
90093 180394
184864 90093
192830 90093
113632 86643
98653 90093
90093 120427
194130 90093
90093 935...

output:

? 170293 90093 183136 11971 154922 190851 184215 117205 195074 23832 115575 128903 69283 180394 184864 192830 98653 120427 194130 93537 50532 128827 132443 137374 117253 33583 16253 99195 126968 25213 76396 88677 118428 105804 187652 41612 7752 13316 51052 116842 155995 163152 4347 195163 181290 198...

result:

ok 18 queries

Test #53:

score: 0
Accepted
time: 279ms
memory: 25312kb

input:

200000
46594 17133
54010 52948
39713 5504
134146 63893
137406 115242
135692 175243
61586 86237
182309 93400
169823 87260
13293 127861
115036 64225
10759 113366
154838 51215
56097 120163
141893 97496
38744 131350
51636 49981
139157 64448
129563 66993
139828 55109
110434 170333
42104 55414
78593 12110...

output:

? 2 57633 16663 8464 
? 1 57633 8464 
? 2 189050 120348 55675 
? 1 189050 120348 
? 2 107643 112760 175242 
? 1 107643 112760 
? 2 98652 12214 68929 
? 1 98652 12214 
? 2 90519 52977 19814 
? 1 90519 52977 
? 2 33656 56251 73222 
? 1 33656 56251 
? 2 51557 23416 168107 
? 1 51557 23416 
? 2 27914 12...

result:

ok 33 queries

Test #54:

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

input:

2
1 2

0

output:

? 1 2 1 
! 1

result:

ok 1 queries

Test #55:

score: 0
Accepted
time: 244ms
memory: 17208kb

input:

199080
129551 173912
70910 17476
121161 95361
83726 135785
11962 41266
77712 58387
175589 92065
190240 33858
58181 157495
56339 185055
117741 24081
48590 78660
60328 55470
176289 123514
79393 113997
24804 16051
156788 178934
83907 2963
90880 61783
169743 151588
188313 97536
76548 170254
85014 117065...

output:

? 3 91401 178836 131846 120684 
? 2 91401 178836 131846 
? 1 91401 178836 
? 3 154097 162364 43297 142592 
? 2 154097 162364 43297 
? 1 154097 162364 
? 3 190293 11988 14163 153030 
? 2 190293 11988 14163 
? 3 135563 76938 185927 100366 
? 2 135563 100366 76938 
? 3 76623 688 11078 129136 
? 2 76623...

result:

ok 31 queries

Test #56:

score: 0
Accepted
time: 231ms
memory: 16920kb

input:

199363
4435 110872
199110 112031
189678 104887
42154 82046
82464 187807
48217 30060
45429 145471
146328 156780
28873 136694
30567 108630
34085 51267
172165 38355
75313 79689
183524 18951
114586 88837
86571 27359
81300 34781
14073 135651
165701 141470
45577 72576
7058 107737
57871 5902
106329 162115
...

output:

? 3 104091 188886 123152 99094 
? 2 104091 123152 99094 
? 1 104091 123152 
? 3 50566 90112 143119 96633 
? 2 50566 143119 90112 
? 3 97289 1896 41895 119009 
? 2 97289 1896 41895 
? 3 42755 2138 69122 152297 
? 2 42755 2138 69122 
? 1 42755 2138 
? 3 140663 153936 88305 105982 
? 2 140663 153936 88...

result:

ok 30 queries

Test #57:

score: 0
Accepted
time: 230ms
memory: 16376kb

input:

198802
45766 110552
171796 133450
94395 18572
138023 89877
70244 17272
45508 74091
114036 89797
19915 145688
45903 15784
139291 33346
193890 197904
184659 18879
2250 147680
28161 164124
16208 160203
168939 77227
33606 105875
191787 126777
190448 76223
40091 174955
142434 44925
195884 101477
157548 5...

output:

? 3 185863 186105 93652 173158 
? 2 185863 186105 173158 
? 1 185863 186105 
? 3 18319 106261 3907 34084 
? 2 18319 34084 106261 
? 3 124708 152977 35537 47153 
? 2 124708 152977 35537 
? 3 26894 19687 168185 137367 
? 2 26894 137367 19687 
? 1 26894 137367 
? 3 68725 58181 133749 176595 
? 2 68725 ...

result:

ok 24 queries

Test #58:

score: 0
Accepted
time: 72ms
memory: 16224kb

input:

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

output:

? 4 2 1 4 5 6 
? 3 2 5 6 4 
? 2 2 5 6 
? 4 10 4 28 29 30 
? 3 10 28 29 30 
? 4 11 4 31 32 33 
? 3 11 32 33 31 
? 2 11 32 33 
? 4 91 31 271 272 273 
? 3 91 271 272 273 
? 4 92 31 274 275 276 
? 3 92 276 275 274 
? 2 92 276 275 
? 1 92 276 
? 4 823 275 2467 2468 2469 
? 3 823 2467 2468 2469 
? 4 824 2...

result:

ok 28 queries

Test #59:

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

input:

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

output:

? 4 2 1 4 5 6 
? 3 2 6 5 4 
? 2 2 6 5 
? 1 2 6 
? 4 13 5 37 38 39 
? 3 13 37 38 39 
? 4 14 5 40 41 42 
? 3 14 42 41 40 
? 2 14 42 41 
? 1 14 42 
? 4 121 41 361 362 363 
? 3 121 361 362 363 
? 4 122 41 364 365 366 
? 3 122 366 365 364 
? 2 122 366 365 
? 1 122 366 
? 4 1093 365 3277 3278 3279 
? 3 10...

result:

ok 29 queries