QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#496939#4218. Hidden GraphhazeWA 9ms5896kbC++232.4kb2024-07-28 17:06:362024-07-28 17:06:36

Judging History

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

  • [2024-07-28 17:06:36]
  • 评测
  • 测评结果:WA
  • 用时:9ms
  • 内存:5896kb
  • [2024-07-28 17:06:36]
  • 提交

answer

/*

Author: Haze

2024/7/28

*/

#include <bits/stdc++.h>

#define irep(i, l, r) for(int i = (l); i <= (r); ++ i)
#define drep(i, r, l) for(int i = (r); i >= (l); -- i)
#define IOS ios::sync_with_stdio(false), cin.tie(nullptr);
using namespace std;
typedef long long ll;

inline ll readL() {
    ll s = 0;
    bool fl = false;
    char ch = (char) getchar();
    while (!isdigit(ch)) {
        if (ch == '-')fl = true;
        ch = (char) getchar();
    }
    while (isdigit(ch)) {
        s = s * 10 + (ch ^ 48);
        ch = (char) getchar();
    }
    return fl ? -s : s;
}

inline int read() {
    return (int) (readL());
}

const int mod = 1000000000 + 7;
const int itinf = 1000000999;
const ll llinf = 2e18;
const int N = 500099;
int F[N], G[N];
std::mt19937 rng(std::chrono::system_clock::now().time_since_epoch().count());

int sum = 0;

vector<array<int, 2>>edge;
void submit(){
    cout << "! " << edge.size() << endl;
    for(auto [u, v] : edge){
        cout << F[u] << ' ' << F[v] << endl;
    }
    exit(0);
}

array<int, 2> query(set<int>&node){
    if(node.size() == 1){
        return {-1, -1};
    }
    if(sum == 6000){
        submit();
    }
    ++ sum;
    cout << "? " << node.size();
    for(int x : node){
        cout << " " << F[x];
    }
    cout << endl;
    array<int, 2>ar{};
    cin >> ar[0] >> ar[1];
    if(ar[0] != -1)ar[0] = G[ar[0]], ar[1] = G[ar[1]];
    return ar;
}

void solve() {
    int n;
    cin >> n;
    irep(i, 1, n)F[i] = i, G[i] = i;
    shuffle(F + 1, F + n + 1, rng);
    irep(i, 1, n){
        G[F[i]] = i;
    }
    vector<set<int>>col = {{1}};

    irep(u, 2, n){
        int to = -1;
        irep(c, 0, col.size() - 1){
            auto vec = col[c];
            vec.emplace(u);
            auto [i, j] = query(vec);
            if(i == -1){
                if(to == -1 or col[to].size() < col[c].size()){
                    to = c;
                }
            }

            while(i != -1){
                edge.push_back({i, j});

                vec.erase(i + j - u);
                auto T = query(vec);
                i = T[0], j = T[1];
            }
        }
        if(to == -1){
            col.push_back({u});
        }
        else col[to].insert(u);
    }
    submit();
}

int main() {
    // IOS
    int T = 1;
    while (T--) {
        solve();
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 0ms
memory: 5864kb

input:

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

output:

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

result:

ok correct

Test #3:

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

input:

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

output:

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

result:

ok correct

Test #4:

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

input:

3
1 3
2 1
-1 -1

output:

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

result:

ok correct

Test #5:

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

input:

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

output:

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

result:

ok correct

Test #6:

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

input:

27
27 11
24 27
-1 -1
-1 -1
-1 -1
21 27
21 24
-1 -1
-1 -1
-1 -1
3 21
-1 -1
14 24
-1 -1
-1 -1
-1 -1
24 10
-1 -1
-1 -1
-1 -1
4 11
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
24 18
-1 -1
21 18
14 5
5 27
5 26
-1 -1
5 11
24 5
3 5
-1 -1
21 5
7 26
-1 -1
-1 -1
-1 -1
-1 -1
14 8
10 8
-1 -1
24 8
-1 -1
21 8
-1 -1
6 14
-...

output:

? 2 27 11
? 2 27 24
? 2 11 24
? 2 27 9
? 3 11 24 9
? 2 27 21
? 4 11 24 9 21
? 3 11 9 21
? 2 27 3
? 4 11 24 9 3
? 2 21 3
? 2 27 14
? 5 11 24 9 3 14
? 4 11 9 3 14
? 2 21 14
? 3 27 14 10
? 5 11 24 9 3 10
? 4 11 9 3 10
? 2 21 10
? 4 27 14 10 4
? 5 11 24 9 3 4
? 4 24 9 3 4
? 2 21 4
? 5 27 14 10 4 26
? 5 ...

result:

ok correct

Test #7:

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

input:

47
-1 -1
-1 -1
20 6
40 6
-1 -1
11 1
20 1
-1 -1
-1 -1
42 11
-1 -1
42 1
-1 -1
-1 -1
-1 -1
-1 -1
22 11
-1 -1
22 6
-1 -1
22 42
20 24
-1 -1
-1 -1
-1 -1
-1 -1
20 32
-1 -1
6 32
-1 -1
-1 -1
-1 -1
11 12
20 12
-1 -1
-1 -1
-1 -1
-1 -1
20 21
21 11
-1 -1
-1 -1
21 42
-1 -1
22 21
-1 -1
23 24
-1 -1
-1 -1
-1 -1
20 4...

output:

? 2 40 11
? 3 40 11 20
? 4 40 11 20 6
? 3 40 11 6
? 2 11 6
? 4 40 11 20 1
? 3 40 20 1
? 2 40 1
? 2 6 1
? 4 40 11 20 42
? 3 40 20 42
? 3 6 1 42
? 2 6 42
? 4 40 11 20 30
? 3 6 1 30
? 2 42 30
? 5 40 11 20 30 22
? 4 40 20 30 22
? 3 6 1 22
? 2 1 22
? 2 42 22
? 5 40 11 20 30 24
? 4 40 11 30 24
? 3 6 1 24
...

result:

ok correct

Test #8:

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

input:

38
-1 -1
11 14
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
28 9
-1 -1
11 28
-1 -1
-1 -1
-1 -1
31 29
31 9
-1 -1
11 31
-1 -1
8 21
-1 -1
-1 -1
28 8
-1 -1
14 5
-1 -1
-1 -1
31 5
-1 -1
-1 -1
4 5
11 4
-1 -1
4 31
-1 -1
4 6
6 14
-1 -1
-1 -1
31 6
-1 -1
4 33
33 9
-1 -1
33 6
-1 -1
31 33
28 33
-1 -1
12 8
11 12
-1 ...

output:

? 2 29 14
? 3 29 14 11
? 2 29 11
? 3 29 14 9
? 2 11 9
? 4 29 14 9 2
? 2 11 2
? 5 29 14 9 2 21
? 2 11 21
? 6 29 14 9 2 21 28
? 5 29 14 2 21 28
? 2 11 28
? 6 29 14 9 2 21 15
? 2 11 15
? 2 28 15
? 7 29 14 9 2 21 15 31
? 6 14 9 2 21 15 31
? 5 14 2 21 15 31
? 2 11 31
? 2 28 31
? 7 29 14 9 2 21 15 8
? 6 2...

result:

ok correct

Test #9:

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

input:

25
5 13
13 22
-1 -1
-1 -1
-1 -1
18 13
18 22
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
10 15
-1 -1
-1 -1
10 3
-1 -1
22 3
-1 -1
-1 -1
7 13
-1 -1
5 7
-1 -1
7 3
-1 -1
-1 -1
24 15
-1 -1
-1 -1
-1 -1
25 24
-1 -1
-1 -1
25 3
-1 -1
7 25
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
12 25
-1 -1
18 12
-1 -1
-1 -1
10 17
-...

output:

? 2 13 5
? 2 13 22
? 2 5 22
? 2 13 1
? 3 5 22 1
? 2 13 18
? 4 5 22 1 18
? 3 5 1 18
? 2 13 23
? 4 5 22 1 23
? 2 18 23
? 2 13 15
? 5 5 22 1 23 15
? 2 18 15
? 2 13 10
? 6 5 22 1 23 15 10
? 5 5 22 1 23 10
? 2 18 10
? 3 13 10 3
? 2 13 3
? 6 5 22 1 23 15 3
? 5 5 1 23 15 3
? 2 18 3
? 3 13 10 7
? 2 10 7
? 6...

result:

ok correct

Test #10:

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

input:

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

output:

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

result:

ok correct

Test #11:

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

input:

3
2 3
2 1
3 1

output:

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

result:

ok correct

Test #12:

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

input:

3
2 1
3 1
-1 -1

output:

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

result:

ok correct

Test #13:

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

input:

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

output:

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

result:

ok correct

Test #14:

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

input:

3
-1 -1
2 1
-1 -1

output:

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

result:

ok correct

Test #15:

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

input:

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

output:

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

result:

ok correct

Test #16:

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

input:

93
-1 -1
-1 -1
-1 -1
-1 -1
88 60
-1 -1
36 85
-1 -1
-1 -1
-1 -1
92 60
-1 -1
-1 -1
-1 -1
-1 -1
42 60
-1 -1
36 41
-1 -1
-1 -1
88 83
83 36
-1 -1
-1 -1
20 38
-1 -1
-1 -1
-1 -1
-1 -1
36 72
-1 -1
-1 -1
-1 -1
40 41
-1 -1
59 14
-1 -1
-1 -1
55 40
55 36
-1 -1
55 83
-1 -1
11 19
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 ...

output:

? 2 88 20
? 3 88 20 36
? 4 88 20 36 39
? 5 88 20 36 39 29
? 6 88 20 36 39 29 60
? 5 20 36 39 29 60
? 6 88 20 36 39 29 85
? 5 88 20 39 29 85
? 2 60 85
? 6 88 20 36 39 29 92
? 3 60 85 92
? 2 85 92
? 7 88 20 36 39 29 92 14
? 3 60 85 14
? 8 88 20 36 39 29 92 14 42
? 3 60 85 42
? 2 85 42
? 9 88 20 36 39 ...

result:

ok correct

Test #17:

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

input:

111
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
83 53
83 50
-1 -1
-1 -1
-1 -1
15 81
-1 -1
-1 -1
95 78
-1 -1
-1 -1
78 22
-1 -1
-1 -1
-1 -1
-1 -1
27 79
79 78
79 55
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
42 27
42 103
-1 -1
42 83
42 95
-1 -1
107 50
107 55
-1 -1
-1 -1
-1 -1
6 50
-1 -1
6 79
-1 -1
42 6
-1...

output:

? 2 11 81
? 3 11 81 40
? 4 11 81 40 33
? 5 11 81 40 33 78
? 6 11 81 40 33 78 13
? 7 11 81 40 33 78 13 50
? 8 11 81 40 33 78 13 50 53
? 9 11 81 40 33 78 13 50 53 27
? 10 11 81 40 33 78 13 50 53 27 83
? 9 11 81 40 33 78 13 50 27 83
? 8 11 81 40 33 78 13 27 83
? 10 11 81 40 33 78 13 50 53 27 9
? 2 83 9...

result:

ok correct

Test #18:

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

input:

132
-1 -1
-1 -1
-1 -1
103 76
-1 -1
-1 -1
-1 -1
88 80
-1 -1
-1 -1
28 15
-1 -1
-1 -1
-1 -1
-1 -1
45 46
-1 -1
45 28
-1 -1
47 125
-1 -1
47 76
-1 -1
-1 -1
-1 -1
76 109
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
70 11
70 49
70 103
-1 -1
-1 -1
-1 -1
103 38
-1 -1
70 38
-1 -1
47 38
-1 -1
79 125
-1 -1
-1 -1
-1 -1
-1 -1
-1...

output:

? 2 103 88
? 3 103 88 46
? 4 103 88 46 15
? 5 103 88 46 15 76
? 4 88 46 15 76
? 5 103 88 46 15 49
? 2 76 49
? 6 103 88 46 15 49 80
? 5 103 46 15 49 80
? 2 76 80
? 6 103 88 46 15 49 28
? 5 103 88 46 49 28
? 3 76 80 28
? 6 103 88 46 15 49 125
? 4 76 80 28 125
? 7 103 88 46 15 49 125 45
? 6 103 88 15 4...

result:

ok correct

Test #19:

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

input:

94
-1 -1
-1 -1
53 40
-1 -1
24 56
-1 -1
24 53
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
27 36
-1 -1
-1 -1
-1 -1
71 80
-1 -1
71 36
-1 -1
-1 -1
11 40
27 11
-1 -1
11 53
-1 -1
11 71
-1 -1
75 30
-1 -1
-1 -1
24 75
75 71
-1 -1
47 83
47 80
-1 -1
47 53
47 75
-1 -1
-1 -1
-1 -1
12 56
-1 -1
53 12
75 ...

output:

? 2 83 40
? 3 83 40 56
? 4 83 40 56 53
? 3 83 56 53
? 4 83 40 56 24
? 3 83 40 24
? 2 53 24
? 4 83 40 56 80
? 2 53 80
? 2 24 80
? 5 83 40 56 80 30
? 2 53 30
? 2 24 30
? 6 83 40 56 80 30 27
? 2 53 27
? 2 24 27
? 7 83 40 56 80 30 27 36
? 6 83 40 56 80 30 36
? 2 53 36
? 2 24 36
? 7 83 40 56 80 30 27 71
...

result:

ok correct

Test #20:

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

input:

73
25 20
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
50 20
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
47 31
-1 -1
-1 -1
-1 -1
19 20
-1 -1
51 25
51 19
51 50
-1 -1
-1 -1
67 68
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
12 20
-1 -1
-1 -1
-1 -1
3 67
3 50
12 3
-1 -1
-1 -1
5 7
-1 -1
-1 -1
29 19
29 25
-1 -1
29 20
-1 -1
25 18
50 18
-1 -1
-1...

output:

? 2 25 20
? 2 25 67
? 2 20 67
? 3 25 67 5
? 2 20 5
? 4 25 67 5 50
? 2 20 50
? 5 25 67 5 50 17
? 2 20 17
? 6 25 67 5 50 17 41
? 2 20 41
? 7 25 67 5 50 17 41 31
? 2 20 31
? 8 25 67 5 50 17 41 31 47
? 7 25 67 5 50 17 41 47
? 2 20 47
? 8 25 67 5 50 17 41 31 19
? 3 20 47 19
? 2 47 19
? 9 25 67 5 50 17 41...

result:

ok correct

Test #21:

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

input:

77
-1 -1
75 56
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
32 65
-1 -1
-1 -1
-1 -1
-1 -1
73 32
76 73
-1 -1
73 56
-1 -1
75 21
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
75 2
-1 -1
-1 -1
-1 -1
4 27
4 31
-1 -1
21 4
2 4
-1 -1
-1 -1
-1 -1
-1 -1
4 30
-1 -1
41 27
75 41
-1 -1
-1 -...

output:

? 2 32 75
? 3 32 75 56
? 2 32 56
? 3 32 75 76
? 2 56 76
? 4 32 75 76 40
? 2 56 40
? 5 32 75 76 40 7
? 2 56 7
? 6 32 75 76 40 7 65
? 5 75 76 40 7 65
? 2 56 65
? 6 32 75 76 40 7 10
? 3 56 65 10
? 7 32 75 76 40 7 10 73
? 6 75 76 40 7 10 73
? 5 75 40 7 10 73
? 3 56 65 73
? 2 65 73
? 7 32 75 76 40 7 10 2...

result:

ok correct

Test #22:

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

input:

81
-1 -1
-1 -1
-1 -1
67 75
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
1 8
8 70
-1 -1
67 8
65 27
-1 -1
-1 -1
-1 -1
60 6
-1 -1
-1 -1
-1 -1
1 5
60 5
-1 -1
67 5
27 5
-1 -1
-1 -1
30 70
30 75
65 30
-1 -1
-1 -1
30 5
-1 -1
1 24
65 24
24 75
-1 -1
30 24
-1 -1
-1 -1
72 75
-1 -1
30 72
67 72
72 6
-1 -1
-1 -1
10 70
10 60
65 1...

output:

? 2 75 68
? 3 75 68 70
? 4 75 68 70 60
? 5 75 68 70 60 67
? 4 68 70 60 67
? 5 75 68 70 60 65
? 2 67 65
? 6 75 68 70 60 65 1
? 2 67 1
? 7 75 68 70 60 65 1 8
? 6 75 68 70 60 65 8
? 5 75 68 60 65 8
? 2 67 8
? 7 75 68 70 60 65 1 27
? 6 75 68 70 60 1 27
? 2 67 27
? 2 8 27
? 7 75 68 70 60 65 1 6
? 6 75 68...

result:

ok correct

Test #23:

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

input:

93
-1 -1
-1 -1
23 8
-1 -1
-1 -1
-1 -1
-1 -1
36 8
-1 -1
-1 -1
86 56
-1 -1
-1 -1
86 91
-1 -1
8 91
-1 -1
2 4
2 86
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
86 29
-1 -1
29 56
-1 -1
-1 -1
86 41
4 41
-1 -1
2 41
-1 -1
29 41
-1 -1
82 59
86 82
4 82
-1 -1
2 82
82 8
-1 -1
82 29
-1 -1
-1 -1
86 21
-1 -1
2 21
-1 -1
-1 ...

output:

? 2 23 18
? 3 23 18 4
? 4 23 18 4 8
? 3 18 4 8
? 4 23 18 4 59
? 2 8 59
? 5 23 18 4 59 36
? 2 8 36
? 6 23 18 4 59 36 86
? 2 8 86
? 7 23 18 4 59 36 86 56
? 6 23 18 4 59 36 56
? 2 8 56
? 7 23 18 4 59 36 86 91
? 6 23 18 4 59 36 91
? 3 8 56 91
? 2 56 91
? 7 23 18 4 59 36 86 2
? 6 23 18 59 36 86 2
? 5 23 ...

result:

ok correct

Test #24:

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

input:

37
-1 -1
-1 -1
-1 -1
22 27
6 27
2 27
-1 -1
4 32
-1 -1
4 27
6 35
35 22
-1 -1
35 27
-1 -1
24 32
22 24
2 24
-1 -1
27 24
4 24
35 24
2 16
-1 -1
27 16
4 16
-1 -1
-1 -1
33 32
-1 -1
33 27
35 33
-1 -1
33 24
33 16
-1 -1
-1 -1
35 17
-1 -1
-1 -1
33 17
15 17
22 15
-1 -1
27 15
-1 -1
24 15
-1 -1
-1 -1
9 32
6 9
2 9...

output:

? 2 6 32
? 3 6 32 2
? 4 6 32 2 22
? 5 6 32 2 22 27
? 4 6 32 2 27
? 3 32 2 27
? 2 32 27
? 5 6 32 2 22 4
? 4 6 2 22 4
? 2 27 4
? 5 6 32 2 22 35
? 4 32 2 22 35
? 3 32 2 35
? 2 27 35
? 2 4 35
? 5 6 32 2 22 24
? 4 6 2 22 24
? 3 6 2 24
? 2 6 24
? 2 27 24
? 3 4 35 24
? 2 35 24
? 5 6 32 2 22 16
? 4 6 32 22 ...

result:

ok correct

Test #25:

score: -100
Wrong Answer
time: 7ms
memory: 5828kb

input:

144
92 116
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
118 87
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
53 71
...

output:

? 2 116 92
? 2 116 37
? 2 92 37
? 3 116 37 122
? 2 92 122
? 4 116 37 122 120
? 2 92 120
? 5 116 37 122 120 32
? 2 92 32
? 6 116 37 122 120 32 61
? 2 92 61
? 7 116 37 122 120 32 61 121
? 2 92 121
? 8 116 37 122 120 32 61 121 21
? 2 92 21
? 9 116 37 122 120 32 61 121 21 18
? 2 92 18
? 10 116 37 122 12...

result:

wrong answer Query Limit Exceeded (lim = 432)