QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#741823#9734. Identify Chorducup-team902AC ✓55ms3916kbC++173.3kb2024-11-13 15:18:052024-12-08 22:59:51

Judging History

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

  • [2024-12-08 22:59:51]
  • 自动重测本题所有获得100分的提交记录
  • 测评结果:AC
  • 用时:55ms
  • 内存:3916kb
  • [2024-12-08 22:59:51]
  • hack成功,自动添加数据
  • (/hack/1274)
  • [2024-11-13 15:18:05]
  • 评测
  • 测评结果:100
  • 用时:60ms
  • 内存:3900kb
  • [2024-11-13 15:18:05]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
int n;
int query(int u, int v)
{
    u = (u % n + n) % n;
    v = (v % n + n) % n;
    printf("? %d %d\n", u + 1, v + 1);
    fflush(stdout);
    int d;
    scanf("%d", &d);
    return d;
}
void answer(int u, int v)
{
    u = (u % n + n) % n;
    v = (v % n + n) % n;
    printf("! %d %d\n", u + 1, v + 1);
    fflush(stdout);
    int t;
    scanf("%d", &t);
    // assert(t == 1);
}
void solve()
{
    scanf("%d", &n);
    if (n & 1)
    {
        int u = 0, v = n / 2, d;
        while (1)
        {
            d = query(u, v);
            if (d != n / 2)
                break;
            v++;
            swap(u, v);
        }
        if (d == 1)
        {
            answer(u, v);
            return;
        }
        if (query(u, v + 1) == d - 1)
        {
            int len = n / 2 - (d - 1) + 1;
            int l = len, r = n / 2;
            while (l <= r)
            {
                int mid = l + r >> 1;
                if (query(u, u - mid) == mid - len + 1)
                    r = mid - 1;
                else
                    l = mid + 1;
            }
            l = u - l;
            if (query(l + len, l) == 1)
                answer(l + len, l);
            else
                answer(2 * u - (l + len), l);
        }
        else
        {
            int len = n / 2 - d + 1;
            int l = len, r = n / 2;
            while (l <= r)
            {
                int mid = l + r >> 1;
                if (query(u, u + mid) == mid - len + 1)
                    r = mid - 1;
                else
                    l = mid + 1;
            }
            l = u + l;
            if (query(l - len, l) == 1)
                answer(l - len, l);
            else
                answer(2 * u - (l - len), l);
        }
    }
    else
    {
        int st = 0, d;
        while (1)
        {
            d = query(st, st + n / 2);
            if (d != n / 2)
                break;
            st++;
        }
        if (d == 1)
        {
            answer(st, st + n / 2);
            return;
        }
        int len = n / 2 - d + 1;
        if (query(st, st + n / 2 - 1) == d - 1)
        {
            int l = len, r = n / 2;
            while (l <= r)
            {
                int mid = l + r >> 1;
                if (query(st, st + mid) == mid - len + 1)
                    r = mid - 1;
                else
                    l = mid + 1;
            }
            l = st + l;
            if (query(l - len, l) == 1)
                answer(l - len, l);
            else
                answer(2 * st - (l - len), l);
        }
        else
        {
            int l = len, r = n / 2;
            while (l <= r)
            {
                int mid = l + r >> 1;
                if (query(st, st - mid) == mid - len + 1)
                    r = mid - 1;
                else
                    l = mid + 1;
            }
            l = st - l;
            if (query(l + len, l) == 1)
                answer(l + len, l);
            else
                answer(2 * st - (l + len), l);
        }
    }
}
int main()
{
    int t;
    scanf("%d", &t);
    while (t--)
        solve();
    return 0;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
6
2
2
2
2
2
1
4
1
1

output:

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

result:

ok ok (2 test cases)

Test #2:

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

input:

1000
15
5
6
5
6
5
1
1
19
5
4
4
3
5
1
17
5
4
4
3
5
1
15
6
7
3
1
1
1
14
5
4
3
3
2
1
1
15
3
2
3
2
3
1
17
8
8
8
7
6
5
5
4
3
1
20
6
5
3
1
1
1
13
5
6
4
4
2
1
18
3
4
2
3
1
1
13
4
3
2
3
1
1
14
2
3
3
2
1
1
17
8
7
6
3
3
2
3
1
12
5
5
3
2
3
2
1
10
5
5
3
4
4
3
3
1
14
6
6
4
6
6
2
1
19
8
7
4
4
3
1
1
19
6
5
3
3
2
3...

output:

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

result:

ok ok (1000 test cases)

Test #3:

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

input:

1000
21
3
4
2
3
3
1
22
8
9
4
4
3
4
1
20
5
6
7
6
5
6
1
22
10
10
6
8
7
7
2
1
21
9
8
6
8
7
3
1
21
8
7
4
5
5
1
1
24
11
10
7
9
8
8
2
1
22
10
10
6
9
9
1
1
21
4
3
2
3
3
1
23
8
7
4
2
3
1
1
21
10
10
10
9
8
4
4
3
3
1
24
9
10
8
9
8
4
1
20
9
9
6
8
9
9
1
1
24
11
10
7
10
10
1
1
23
8
9
4
2
1
1
1
23
7
6
3
5
4
5
1
2...

output:

? 1 11
? 1 12
? 1 10
? 1 9
? 2 10
! 21 10
? 1 12
? 1 11
? 1 16
? 1 18
? 1 17
? 21 17
! 3 17
? 1 11
? 1 10
? 1 13
? 1 12
? 1 11
? 17 11
! 5 11
? 1 12
? 1 11
? 1 17
? 1 14
? 1 16
? 1 15
? 17 15
! 7 15
? 1 11
? 1 12
? 1 16
? 1 14
? 1 13
? 16 13
! 7 13
? 1 11
? 1 12
? 1 15
? 1 17
? 1 16
? 19 15
! 19 15
...

result:

ok ok (1000 test cases)

Test #4:

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

input:

1000
25
8
9
4
2
1
1
1
25
6
7
3
3
2
3
1
25
11
12
6
4
4
2
1
25
5
6
3
5
4
1
1
26
12
12
7
9
8
8
1
1
26
11
10
6
3
3
4
3
1
26
13
13
11
12
6
3
1
1
1
27
12
13
7
9
8
8
1
1
25
9
10
8
10
10
9
4
1
27
9
10
5
6
5
4
1
1
27
11
10
8
8
9
9
1
1
27
13
13
13
13
12
11
6
5
6
7
3
1
26
5
6
3
5
4
1
1
25
11
12
6
3
2
2
2
1
27
...

output:

? 1 13
? 1 14
? 1 9
? 1 7
? 1 6
? 1 6
! 1 6
? 1 13
? 1 14
? 1 10
? 1 8
? 1 9
? 2 9
! 25 9
? 1 13
? 1 14
? 1 8
? 1 5
? 1 6
? 4 6
! 23 6
? 1 13
? 1 14
? 1 11
? 1 9
? 1 10
? 3 11
! 3 11
? 1 14
? 1 13
? 1 20
? 1 17
? 1 19
? 1 18
? 20 18
! 20 18
? 1 14
? 1 13
? 1 9
? 1 6
? 1 4
? 1 5
? 3 6
! 25 6
? 1 14
?...

result:

ok ok (1000 test cases)

Test #5:

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

input:

1000
29
10
9
5
4
3
5
1
28
13
12
7
4
6
6
2
1
30
3
4
2
3
3
1
29
4
5
2
3
1
1
28
8
7
10
8
7
7
1
29
6
5
3
5
4
5
1
29
9
8
4
6
5
1
1
28
11
10
9
9
9
8
1
1
30
4
5
6
5
4
1
1
30
8
7
10
8
7
8
1
28
11
12
9
11
10
4
1
29
14
13
14
7
4
5
5
1
1
29
11
12
6
3
4
4
1
1
29
7
8
10
8
7
8
1
29
14
14
14
13
14
8
11
13
13
1
1
3...

output:

? 1 15
? 1 16
? 1 20
? 1 23
? 1 22
? 28 22
! 3 22
? 1 15
? 1 14
? 1 9
? 1 5
? 1 7
? 1 8
? 6 8
! 24 8
? 1 16
? 1 15
? 1 17
? 1 18
? 30 17
! 2 17
? 1 15
? 1 16
? 1 13
? 1 12
? 2 13
! 2 13
? 1 15
? 1 14
? 1 11
? 1 13
? 1 14
? 7 14
! 23 14
? 1 15
? 1 16
? 1 18
? 1 20
? 1 19
? 28 18
! 3 18
? 1 15
? 1 16
...

result:

ok ok (1000 test cases)

Test #6:

score: 0
Accepted
time: 21ms
memory: 3880kb

input:

1000
32
13
12
7
6
5
6
1
1
30
14
14
7
4
5
4
1
1
32
16
16
14
15
7
5
7
8
3
1
31
5
6
5
4
1
1
32
7
8
4
4
3
5
1
32
8
9
4
2
3
3
1
31
15
14
13
7
3
3
4
3
1
31
6
5
3
3
2
1
1
32
12
11
10
11
11
10
1
1
30
14
14
7
4
6
6
1
1
31
11
12
6
5
4
5
1
31
10
9
11
11
10
9
1
1
33
7
8
4
2
1
1
1
32
11
12
6
8
8
7
6
1
32
6
5
5
5...

output:

? 1 17
? 1 16
? 1 11
? 1 7
? 1 9
? 1 8
? 5 9
! 5 9
? 1 16
? 1 15
? 1 23
? 1 27
? 1 25
? 1 26
? 28 26
! 28 26
? 1 17
? 2 18
? 3 19
? 3 18
? 3 26
? 3 30
? 3 28
? 3 27
? 29 26
! 9 26
? 1 16
? 1 17
? 1 14
? 1 15
? 4 15
! 4 15
? 1 17
? 1 16
? 1 20
? 1 22
? 1 21
? 31 21
! 3 21
? 1 17
? 1 16
? 1 21
? 1 23
...

result:

ok ok (1000 test cases)

Test #7:

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

input:

1000
34
17
16
16
8
4
3
4
2
1
33
8
9
8
6
7
1
1
33
11
10
5
6
5
4
1
1
34
11
10
6
5
4
7
1
34
11
12
6
3
3
2
3
1
35
14
15
7
3
1
1
1
34
8
7
4
4
3
5
1
34
14
15
7
6
5
6
4
1
34
16
15
8
4
3
4
1
1
33
9
8
8
6
7
1
1
33
16
16
16
16
15
16
9
13
15
15
1
1
34
16
16
8
4
2
1
1
1
33
13
14
10
12
12
11
4
1
34
16
15
9
13
14...

output:

? 1 18
? 2 19
? 2 18
? 2 27
? 2 31
? 2 33
? 2 32
? 33 31
! 5 31
? 1 17
? 1 18
? 1 13
? 1 15
? 1 14
? 6 15
! 6 15
? 1 17
? 1 18
? 1 23
? 1 26
? 1 25
? 1 24
? 31 24
! 31 24
? 1 18
? 1 17
? 1 13
? 1 10
? 1 11
? 4 11
! 32 11
? 1 18
? 1 17
? 1 23
? 1 26
? 1 28
? 1 27
? 34 27
! 2 27
? 1 18
? 1 19
? 1 11
?...

result:

ok ok (1000 test cases)

Test #8:

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

input:

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

output:

? 1 19
? 2 20
? 2 19
? 2 28
? 2 24
? 2 22
? 2 21
? 2 20
? 22 20
! 18 20
? 1 19
? 1 18
? 1 20
? 1 19
? 35 19
! 35 19
? 1 19
? 1 18
? 1 13
? 1 9
? 1 11
? 1 10
? 4 10
! 4 10
? 1 19
? 1 18
? 1 17
? 1 15
? 1 16
? 3 17
! 3 17
? 1 19
? 2 20
? 2 19
? 2 28
? 2 33
? 2 31
? 2 32
? 34 32
! 6 32
? 1 19
? 1 18
? ...

result:

ok ok (1000 test cases)

Test #9:

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

input:

1000
37
17
18
10
13
12
12
2
1
36
17
17
10
13
11
10
1
1
38
9
8
9
7
8
1
1
37
15
14
11
15
13
14
5
1
37
12
13
12
15
13
12
7
1
36
8
9
4
6
5
1
1
37
6
5
3
5
4
1
1
37
18
18
18
18
17
16
8
6
8
9
3
1
37
17
18
10
14
16
17
17
2
1
37
8
7
8
6
7
11
1
37
10
9
5
4
3
1
1
37
18
18
18
17
18
10
14
16
17
17
1
1
36
3
4
2
3...

output:

? 1 19
? 1 20
? 1 11
? 1 15
? 1 13
? 1 14
? 12 14
! 27 14
? 1 19
? 1 18
? 1 27
? 1 23
? 1 25
? 1 26
? 28 26
! 28 26
? 1 20
? 1 19
? 1 16
? 1 18
? 1 17
? 7 18
! 7 18
? 1 19
? 1 20
? 1 27
? 1 23
? 1 21
? 1 22
? 26 21
! 13 21
? 1 19
? 1 20
? 1 13
? 1 16
? 1 18
? 1 19
? 12 19
! 27 19
? 1 19
? 1 18
? 1 2...

result:

ok ok (1000 test cases)

Test #10:

score: 0
Accepted
time: 14ms
memory: 3744kb

input:

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

output:

? 1 20
? 1 21
? 1 29
? 1 25
? 1 27
? 1 26
? 28 25
! 13 25
? 1 20
? 1 19
? 1 24
? 1 22
? 1 21
? 33 21
! 33 21
? 1 20
? 2 21
? 3 22
? 3 21
? 3 30
? 3 26
? 3 28
? 3 27
? 29 26
! 15 26
? 1 20
? 1 21
? 1 14
? 1 11
? 1 9
? 1 10
? 2 10
! 2 10
? 1 20
? 1 19
? 1 27
? 1 23
? 1 21
? 1 22
? 26 21
! 26 21
? 1 20...

result:

ok ok (1000 test cases)

Test #11:

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

input:

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

output:

? 1 21
? 1 20
? 1 27
? 1 24
? 1 26
? 35 26
! 7 26
? 1 21
? 1 20
? 1 30
? 1 25
? 1 28
? 1 27
? 30 27
! 12 27
? 1 21
? 1 20
? 1 28
? 1 32
? 1 34
? 1 33
? 39 33
! 3 33
? 1 21
? 1 20
? 1 17
? 1 15
? 1 14
? 1 14
! 1 14
? 1 21
? 1 20
? 1 29
? 1 25
? 1 23
? 1 24
? 28 23
! 28 23
? 1 21
? 1 20
? 1 14
? 1 18
...

result:

ok ok (1000 test cases)

Test #12:

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

input:

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

output:

? 1 22
? 1 21
? 1 17
? 1 14
? 1 15
? 1 16
? 6 17
! 6 17
? 1 21
? 1 22
? 1 30
? 1 34
? 1 32
? 1 33
? 38 33
! 38 33
? 1 21
? 1 22
? 1 17
? 1 15
? 1 16
? 3 16
! 40 16
? 1 21
? 1 22
? 1 15
? 1 18
? 1 16
? 7 16
! 36 16
? 1 21
? 1 22
? 1 27
? 1 24
? 1 23
? 33 23
! 10 23
? 1 21
? 1 22
? 1 12
? 1 7
? 1 9
? ...

result:

ok ok (1000 test cases)

Test #13:

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

input:

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

output:

? 1 22
? 1 23
? 1 20
? 1 21
? 3 21
! 3 21
? 1 22
? 1 21
? 1 13
? 1 18
? 1 20
? 1 19
? 16 20
! 16 20
? 1 22
? 1 23
? 1 19
? 1 21
? 1 20
? 5 21
! 5 21
? 1 22
? 1 23
? 1 13
? 1 18
? 1 15
? 1 14
? 10 14
! 35 14
? 1 22
? 23 1
? 2 23
? 24 2
? 24 3
? 24 12
? 24 7
? 24 5
? 24 6
? 8 5
! 40 5
? 1 22
? 1 23
? ...

result:

ok ok (1000 test cases)

Test #14:

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

input:

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

output:

? 1 23
? 2 24
? 3 25
? 3 24
? 3 35
? 3 40
? 3 43
? 3 42
? 3 41
? 44 41
! 6 41
? 1 23
? 1 22
? 1 28
? 1 31
? 1 30
? 1 29
? 41 29
! 5 29
? 1 22
? 1 23
? 1 28
? 1 25
? 1 24
? 36 24
! 36 24
? 1 22
? 23 1
? 2 23
? 24 2
? 3 24
? 3 25
? 3 34
? 3 29
? 3 27
? 3 28
? 31 28
! 18 28
? 1 23
? 1 22
? 1 32
? 1 37
...

result:

ok ok (1000 test cases)

Test #15:

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

input:

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

output:

? 1 23
? 1 24
? 1 13
? 1 8
? 1 5
? 1 4
? 2 5
! 45 5
? 1 23
? 1 24
? 1 15
? 1 11
? 1 13
? 1 12
? 5 12
! 42 12
? 1 23
? 1 24
? 1 18
? 1 15
? 1 16
? 1 17
? 5 18
! 5 18
? 1 23
? 1 24
? 1 31
? 1 35
? 1 33
? 1 32
? 41 32
! 6 32
? 1 23
? 1 24
? 1 18
? 1 15
? 1 13
? 1 14
? 2 14
! 2 14
? 1 23
? 1 24
? 1 15
?...

result:

ok ok (1000 test cases)

Test #16:

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

input:

1000
46
18
19
13
14
11
12
6
1
46
9
10
5
6
5
4
7
1
46
22
22
11
6
8
7
7
2
1
46
19
18
10
7
7
6
1
1
46
5
4
3
1
1
1
46
21
22
13
16
15
14
3
1
46
18
19
14
14
13
12
6
1
46
16
17
15
12
14
13
8
1
46
22
22
12
18
21
21
1
1
46
5
6
3
3
2
3
1
45
19
18
9
8
8
7
1
1
46
14
13
7
7
5
6
9
1
46
18
19
14
18
16
17
1
1
46
11...

output:

? 1 24
? 1 23
? 1 33
? 1 28
? 1 31
? 1 32
? 37 31
! 11 31
? 1 24
? 1 23
? 1 28
? 1 31
? 1 30
? 1 29
? 44 29
! 4 29
? 1 24
? 1 23
? 1 35
? 1 41
? 1 38
? 1 40
? 1 39
? 41 39
! 7 39
? 1 24
? 1 23
? 1 15
? 1 10
? 1 12
? 1 11
? 6 11
! 6 11
? 1 24
? 1 23
? 1 22
? 1 20
? 1 20
! 1 20
? 1 24
? 1 23
? 1 34
? ...

result:

ok ok (1000 test cases)

Test #17:

score: 0
Accepted
time: 32ms
memory: 3916kb

input:

1000
1000000000
499999999
499999999
250000000
125000001
187500000
156250000
140625000
132812500
128906250
126953126
127929688
128417968
128173827
128051757
127990722
127960204
127944946
127952575
127956389
127954481
127953527
127953050
127952812
127952693
127952633
127952604
127952619
127952625
1279...

output:

? 1 500000001
? 1 500000000
? 1 750000000
? 1 875000000
? 1 812500000
? 1 843750000
? 1 859375000
? 1 867187500
? 1 871093750
? 1 873046875
? 1 872070313
? 1 871582032
? 1 871826173
? 1 871948243
? 1 872009278
? 1 872039796
? 1 872055055
? 1 872047426
? 1 872043611
? 1 872045519
? 1 872046473
? 1 87...

result:

ok ok (1000 test cases)

Test #18:

score: 0
Accepted
time: 39ms
memory: 3880kb

input:

1000
1000000000
499999969
499999968
250000016
375000008
437499973
406249975
390625007
398437506
402343756
404296850
403320287
402832037
403076177
403198247
403259251
403228764
403244023
403251621
403247837
403249744
403250698
403251144
403250905
403250817
403250876
403250875
403250886
403250879
4032...

output:

? 1 500000001
? 1 500000000
? 1 250000017
? 1 375000009
? 1 437500005
? 1 406250007
? 1 390625008
? 1 398437507
? 1 402343757
? 1 404296882
? 1 403320319
? 1 402832038
? 1 403076178
? 1 403198248
? 1 403259283
? 1 403228765
? 1 403244024
? 1 403251653
? 1 403247838
? 1 403249745
? 1 403250699
? 1 40...

result:

ok ok (1000 test cases)

Test #19:

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

input:

1000
1000000000
474148191
474148192
237074096
144388857
203657381
233291643
248108774
244482662
240778379
238926238
238000167
237537132
237305614
237189855
237131976
237103036
237088566
237081331
237077714
237075905
237075001
237074549
237074323
237074210
237074153
237074125
237074111
237074104
2370...

output:

? 1 500000001
? 1 500000000
? 1 737074096
? 1 855611144
? 1 796342620
? 1 766708358
? 1 751891227
? 1 744482662
? 1 740778379
? 1 738926238
? 1 738000167
? 1 737537132
? 1 737305614
? 1 737189855
? 1 737131976
? 1 737103036
? 1 737088566
? 1 737081331
? 1 737077714
? 1 737075905
? 1 737075001
? 1 73...

result:

ok ok (1000 test cases)

Test #20:

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

input:

1000
1000000000
230485382
230485381
115242763
172864037
144053364
129648027
122445359
118844025
117043358
116143024
115692857
115467774
115355232
115298961
115270826
115256758
115249724
115246207
115244449
115243570
115243130
115242910
115242800
115242745
115242736
115242731
115242730
115242727
1152...

output:

? 1 500000001
? 1 500000000
? 1 384757310
? 1 442378656
? 1 413567983
? 1 399162646
? 1 391959978
? 1 388358644
? 1 386557977
? 1 385657643
? 1 385207476
? 1 384982393
? 1 384869851
? 1 384813580
? 1 384785445
? 1 384771377
? 1 384764343
? 1 384760826
? 1 384759068
? 1 384758189
? 1 384757749
? 1 38...

result:

ok ok (1000 test cases)

Test #21:

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

input:

1000
1000000000
288090905
288090906
144045453
72022726
47732739
54017044
45014203
43231319
42763493
42105964
42200815
41919476
41965295
41894961
41884308
41877378
41875516
41872982
41873318
41872219
41872433
41872158
41872081
41872090
41872056
41872063
41872054
41872052
41872052
41872051
1
1
1000000...

output:

? 1 500000001
? 1 500000000
? 1 644045453
? 1 716068180
? 1 752079543
? 1 734073862
? 1 743076703
? 1 747578123
? 1 745327413
? 1 746452768
? 1 745890091
? 1 746171430
? 1 746312099
? 1 746241765
? 1 746206598
? 1 746224182
? 1 746215390
? 1 746219786
? 1 746217588
? 1 746218687
? 1 746219237
? 1 74...

result:

ok ok (1000 test cases)

Test #22:

score: 0
Accepted
time: 55ms
memory: 3876kb

input:

1000
999999999
499999998
499999999
249999999
125000000
187500000
218749999
203125000
210937500
214843750
216796875
217773437
218261718
218505859
218627928
218566894
218597411
218612670
218620298
218616484
218618391
218619344
218618867
218618628
218618510
218618568
218618539
218618553
218618546
21861...

output:

? 1 500000000
? 1 500000001
? 1 250000001
? 1 125000001
? 1 187500001
? 1 218750001
? 1 203125001
? 1 210937501
? 1 214843751
? 1 216796876
? 1 217773438
? 1 218261719
? 1 218505860
? 1 218627930
? 1 218566895
? 1 218597412
? 1 218612671
? 1 218620300
? 1 218616485
? 1 218618392
? 1 218619346
? 1 21...

result:

ok ok (1000 test cases)

Test #23:

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

input:

1000
999999999
499999957
499999956
250000021
374999967
312499972
281250018
296875016
304687515
308593765
310546890
311523452
312011690
311767592
311889619
311828584
311798109
311813368
311820997
311824769
311822904
311823823
311824292
311824053
311823934
311823874
311823844
311823829
311823822
31182...

output:

? 1 500000000
? 1 500000001
? 1 749999979
? 1 624999990
? 1 687499985
? 1 718749982
? 1 703124984
? 1 695312485
? 1 691406235
? 1 689453110
? 1 688476548
? 1 687988267
? 1 688232408
? 1 688110338
? 1 688171373
? 1 688201891
? 1 688186632
? 1 688179003
? 1 688175188
? 1 688177096
? 1 688176142
? 1 68...

result:

ok ok (1000 test cases)

Test #24:

score: 0
Accepted
time: 28ms
memory: 3784kb

input:

1000
999999999
324545945
324545944
162272974
243409458
202841215
182557093
172415032
167344002
164808487
163540729
162906850
162589911
162431441
162352206
162312589
162292780
162282876
162277924
162275448
162274210
162273591
162273281
162273126
162273049
162273010
162272991
162272981
162272976
16227...

output:

? 1 500000000
? 1 500000001
? 1 662272973
? 1 581136487
? 1 621704730
? 1 641988852
? 1 652130913
? 1 657201943
? 1 659737458
? 1 661005216
? 1 661639095
? 1 661956034
? 1 662114504
? 1 662193739
? 1 662233356
? 1 662253165
? 1 662263069
? 1 662268021
? 1 662270497
? 1 662271735
? 1 662272354
? 1 66...

result:

ok ok (1000 test cases)

Test #25:

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

input:

1000
999999999
487015083
487015084
243507608
365261313
304384427
273945984
258726763
251117152
247312347
245409944
244458743
243983142
243745342
243626442
243566992
243537267
243522404
243514973
243511257
243509399
243508470
243508006
243507774
243507658
243507600
243507579
243507585
243507578
24350...

output:

? 1 500000000
? 1 500000001
? 1 256492459
? 1 378246230
? 1 317369344
? 1 286930901
? 1 271711680
? 1 264102069
? 1 260297264
? 1 258394861
? 1 257443660
? 1 256968059
? 1 256730259
? 1 256611359
? 1 256551909
? 1 256522184
? 1 256507321
? 1 256499890
? 1 256496174
? 1 256494316
? 1 256493387
? 1 25...

result:

ok ok (1000 test cases)

Test #26:

score: 0
Accepted
time: 50ms
memory: 3884kb

input:

1000
999999999
265285129
265285128
132642564
66321282
33160641
16580320
8290160
11875166
9802626
8766356
8248221
8031092
8118688
8053921
8021538
8014900
8013442
8010852
8011418
8010406
8010346
8010153
8010219
8010156
8010124
8010138
8010130
8010126
8010124
8010123
16020245
1
999999999
450448164
4504...

output:

? 1 500000000
? 1 500000001
? 1 632642565
? 1 698963847
? 1 732124488
? 1 748704809
? 1 756994969
? 1 761140049
? 1 759067509
? 1 758031239
? 1 757513104
? 1 757254037
? 1 757383571
? 1 757318804
? 1 757286421
? 1 757270229
? 1 757278325
? 1 757274277
? 1 757276301
? 1 757275289
? 1 757274783
? 1 75...

result:

ok ok (1000 test cases)

Test #27:

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

input:

1000
536870912
261621269
261621268
137624822
196215952
170327480
186678809
188040287
186024620
185996370
185002662
185485391
185229901
185102156
185038284
185006348
184990380
184994678
184990686
184988690
184989382
184988883
184988633
184988566
184988570
184988539
184988551
184988543
184988539
18498...

output:

? 1 268435457
? 1 268435456
? 1 137624823
? 1 203030140
? 1 170327481
? 1 186678810
? 1 194854475
? 1 190766642
? 1 192810558
? 1 191788600
? 1 192299579
? 1 192044089
? 1 191916344
? 1 191852472
? 1 191820536
? 1 191804568
? 1 191796584
? 1 191800576
? 1 191802572
? 1 191803570
? 1 191803071
? 1 19...

result:

ok ok (1000 test cases)

Test #28:

score: 0
Accepted
time: 28ms
memory: 3916kb

input:

1000
536870911
244408485
244408484
122204242
67657827
91653181
76377651
68739886
64921003
65748386
64793666
64443642
64554986
64435646
64383972
64405811
64390894
64383435
64380242
64381571
64380639
64380173
64380008
64380057
64379999
64379978
64379985
64379978
64379974
64379976
64379975
1
1
53687091...

output:

? 1 268435456
? 1 268435457
? 1 390639699
? 1 451741820
? 1 421190760
? 1 436466290
? 1 444104055
? 1 447922938
? 1 449832379
? 1 448877659
? 1 448400299
? 1 448638979
? 1 448519639
? 1 448459969
? 1 448489804
? 1 448474887
? 1 448467428
? 1 448463699
? 1 448465564
? 1 448464632
? 1 448464166
? 1 44...

result:

ok ok (1000 test cases)

Extra Test:

score: 0
Extra Test Passed