QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#724917#8239. Mysterious TreeChiTangAC ✓8ms3716kbC++173.2kb2024-11-08 15:33:412024-11-08 15:33:43

Judging History

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

  • [2024-11-08 15:33:43]
  • 评测
  • 测评结果:AC
  • 用时:8ms
  • 内存:3716kb
  • [2024-11-08 15:33:41]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

#define int long long

const int N = 2e5 + 10;

void solve()
{
    int n;
    cin >> n;

    int numedge = 0;
    int u, v;
    int uu, vv;

    for (int i = 1; i <= n - 1; i += 2)
    {
        cout << "? " << i << ' ' << i + 1 << endl;
        cout.flush();
        int e;
        cin >> e;
        if (e)
        {
            numedge++;
            u = i;
            v = i + 1;
        }
        else
        {
            uu = i;
            vv = i + 1;
        }
    }
    if (numedge >= 2)
    {
        cout << "! 1" << endl;
        cout.flush();

        return;
    }
    if (n % 2 == 1)
    {
        cout << "? " << uu << ' ' << n << endl;
        cout.flush();
        int e;
        cin >> e;
        if (e)
        {
            numedge++;
            u = uu;
            v = n;
        }
    }

    if (numedge == 1)
    {
        int w;
        int ww;
        for (int i = 1; i <= n; i++)
        {
            if (i != u && i != v)
            {
                w = i;
                break;
            }
        }
        cout << "? " << w << ' ' << u << endl;
        cout.flush();
        int e;
        cin >> e;
        if (e)
        {
            for (int i = 1; i <= n; i++)
            {
                if (i != u && i != v && i != w)
                {
                    ww = i;
                    break;
                }
            }
            cout << "? " << ww << ' ' << u << endl;
            cout.flush();
            int e;
            cin >> e;
            if (e)
            {
                cout << "! 2" << endl;
                cout.flush();
                return;
            }
            else
            {
                cout << "! 1" << endl;
                cout.flush();
                return;
            }
        }
        else
        {
            cout << "? " << w << ' ' << v << endl;
            cout.flush();
            int e;
            cin >> e;
            if (e)
            {
                for (int i = 1; i <= n; i++)
                {
                    if (i != u && i != v && i != w)
                    {
                        ww = i;
                        break;
                    }
                }
                cout << "? " << ww << ' ' << v << endl;
                cout.flush();
                int e;
                cin >> e;
                if (e)
                {
                    cout << "! 2" << endl;
                    cout.flush();
                    return;
                }
                else
                {
                    cout << "! 1" << endl;
                    cout.flush();
                    return;
                }
            }else{
                cout << "! 1" << endl;
                    cout.flush();
                    return;
            }
        }
    }
    else
    {
        cout << "! 1" << endl;
        cout.flush();

        return;
    }
}

signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);

    int t = 1;
    cin >> 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: 3592kb

input:

2
4
1
1
4
0
1
1
1

output:

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

result:

ok Correct (2 test cases)

Test #2:

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

input:

87
13
0
0
0
0
0
1
0
0
1
1
15
0
0
0
0
0
0
1
0
1
1
7
0
0
0
1
0
1
1
15
0
0
0
1
1
0
0
19
0
0
0
0
0
1
0
0
0
0
1
1
20
0
0
0
0
0
0
0
0
0
0
7
0
0
1
0
0
1
1
20
0
0
0
0
0
0
0
1
0
0
1
1
17
0
0
0
0
0
0
0
0
0
11
1
1
0
0
0
14
0
0
0
0
0
0
0
13
0
0
0
0
0
0
1
0
0
18
0
0
0
0
0
1
0
0
0
0
1
1
14
0
1
0
0
0
0
0
0
1
1
20
...

output:

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

result:

ok Correct (87 test cases)

Test #3:

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

input:

135
9
1
0
1
1
6
0
0
0
11
0
0
0
0
1
1
4
1
1
10
0
0
0
0
1
1
1
9
0
0
0
1
0
1
1
9
0
0
1
0
0
0
1
1
6
0
0
0
9
0
0
0
1
0
1
1
11
0
0
0
0
1
0
0
0
4
0
0
4
1
0
1
1
8
0
0
0
0
5
0
0
0
7
1
0
0
1
11
0
0
0
0
1
0
0
1
1
4
1
0
1
1
6
1
0
0
1
1
9
0
0
1
0
0
1
1
4
1
0
0
1
1
8
1
0
1
0
9
0
0
1
0
0
0
1
1
7
0
0
1
1
4
1
0
1
1
...

output:

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

result:

ok Correct (135 test cases)

Test #4:

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

input:

136
8
0
0
0
1
0
1
1
5
1
0
0
0
1
1
11
0
0
1
0
0
0
0
0
10
1
0
0
0
0
0
0
6
0
0
0
9
0
0
1
0
0
0
1
1
7
0
1
0
0
1
1
10
0
0
1
0
0
0
1
1
7
0
0
1
0
1
1
9
0
0
1
0
0
1
1
5
0
0
1
0
1
1
7
0
0
0
0
10
0
0
1
0
0
0
1
1
6
0
1
1
6
0
0
1
0
1
0
6
0
1
0
0
1
1
10
0
1
0
0
0
1
1
9
0
0
1
0
0
1
1
5
0
1
0
1
1
6
0
0
1
1
1
4
0
0...

output:

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

result:

ok Correct (136 test cases)

Test #5:

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

input:

5
100
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
758
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 69 70
? 71 72
? 73 74
? 75 76
? 77 ...

result:

ok Correct (5 test cases)

Test #6:

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

input:

7
147
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
801
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
...

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 69 70
? 71 72
? 73 74
? 75 76
? 77 ...

result:

ok Correct (7 test cases)

Test #7:

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

input:

160
4
0
0
9
0
0
0
0
0
7
0
0
0
1
0
1
1
4
0
0
9
0
0
0
0
1
0
1
1
9
0
0
0
0
1
0
1
1
6
0
0
1
0
1
1
7
0
0
0
1
0
1
1
4
0
0
6
0
0
1
0
1
1
4
0
0
5
0
0
1
0
1
1
7
0
0
0
1
0
1
1
4
0
1
0
1
1
7
0
0
0
0
6
0
0
0
9
0
0
0
0
0
9
0
0
0
0
0
4
0
0
4
0
0
4
0
0
5
0
0
1
0
1
1
9
0
0
0
0
0
6
0
0
0
9
0
0
0
0
0
5
0
0
1
0
1
1
6
...

output:

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

result:

ok Correct (160 test cases)

Test #8:

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

input:

117
6
0
0
0
7
0
0
0
0
11
0
0
0
0
0
1
0
1
1
4
0
0
11
0
0
0
0
0
0
5
0
0
1
0
1
1
10
0
0
0
0
0
9
0
0
0
0
1
0
1
1
10
0
0
0
0
1
0
1
1
11
0
0
0
0
0
0
9
0
0
0
0
0
13
0
0
0
0
0
0
0
11
0
0
0
0
0
0
13
0
0
0
0
0
0
0
8
0
0
0
1
0
1
1
13
0
0
0
0
0
0
0
11
0
0
0
0
0
1
0
1
1
11
0
0
0
0
0
0
11
0
0
0
0
0
0
8
0
0
0
0
6
...

output:

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

result:

ok Correct (117 test cases)

Test #9:

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

input:

99
14
0
0
0
0
0
0
1
0
1
1
6
0
0
1
0
1
1
13
0
0
0
0
0
0
0
4
0
0
14
0
0
0
0
0
0
0
11
0
0
0
0
0
0
11
0
0
0
0
0
0
11
0
0
0
0
0
1
0
1
1
15
0
0
0
0
0
0
0
1
0
1
1
4
0
0
12
0
0
0
0
0
0
14
0
0
0
0
0
0
1
0
1
1
13
0
0
0
0
0
0
1
0
1
1
9
0
0
0
0
1
0
1
1
8
0
0
0
0
7
0
0
0
0
7
0
0
0
1
0
1
1
4
0
0
8
0
0
0
1
0
1
1
1...

output:

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

result:

ok Correct (99 test cases)

Test #10:

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

input:

84
18
0
0
0
0
0
0
0
0
0
14
0
0
0
0
0
0
0
17
0
0
0
0
0
0
0
0
1
0
1
1
13
0
0
0
0
0
0
0
11
0
0
0
0
0
1
0
1
1
7
0
0
0
0
14
0
0
0
0
0
0
0
12
0
0
0
0
0
0
17
0
0
0
0
0
0
0
0
1
0
1
1
6
0
0
0
9
0
0
0
0
0
10
0
0
0
0
1
0
1
1
5
0
0
1
0
1
1
4
0
0
6
0
0
0
15
0
0
0
0
0
0
0
0
4
0
0
17
0
0
0
0
0
0
0
0
1
0
1
1
12
0
0...

output:

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

result:

ok Correct (84 test cases)

Test #11:

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

input:

23
27
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
1
12
0
0
0
0
0
0
93
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
100
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
1
6
0
0
0
59
0
0
0
0
0
0
0
0
0
0
0
0
0
0...

output:

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

result:

ok Correct (23 test cases)

Test #12:

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

input:

20
39
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
1
44
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
1
85
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
1
1
35
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
1
94
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

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

result:

ok Correct (20 test cases)

Test #13:

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

input:

9
69
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
189
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
1
72
0
0
0
0
0
0
0
0
0
0
0
...

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 67 69
! 1
? 1 2
? 3 4
? 5 6
? 7 8
?...

result:

ok Correct (9 test cases)

Test #14:

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

input:

6
243
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
181
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 69 70
? 71 72
? 73 74
? 75 76
? 77 ...

result:

ok Correct (6 test cases)

Test #15:

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

input:

4
613
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 69 70
? 71 72
? 73 74
? 75 76
? 77 ...

result:

ok Correct (4 test cases)

Test #16:

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

input:

146
6
1
1
1
9
1
1
1
1
4
1
0
1
1
9
1
0
0
0
0
1
1
7
1
1
1
6
1
0
0
1
1
5
1
1
9
1
0
0
0
0
1
1
7
1
1
1
4
1
0
1
1
9
1
1
1
1
5
1
0
0
1
1
4
1
1
9
1
0
0
0
0
1
1
5
1
1
4
1
1
9
1
1
1
1
6
1
1
1
5
1
1
9
1
1
1
1
6
1
1
1
5
1
1
7
1
1
1
5
1
1
5
1
1
5
1
1
7
1
0
0
0
1
1
4
1
1
4
1
1
6
1
1
1
8
1
1
1
1
7
1
1
1
5
1
1
9
1
...

output:

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

result:

ok Correct (146 test cases)

Test #17:

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

input:

117
4
1
1
4
1
0
1
1
12
1
0
0
0
0
0
1
1
7
1
0
0
0
1
1
12
1
1
1
1
1
1
9
1
0
0
0
0
1
1
10
1
0
0
0
0
1
1
13
1
1
1
1
1
1
11
1
0
0
0
0
0
1
1
9
1
1
1
1
12
1
0
0
0
0
0
1
1
11
1
1
1
1
1
4
1
1
10
1
0
0
0
0
1
1
5
1
0
0
1
1
5
1
0
0
1
1
5
1
0
0
1
1
4
1
1
4
1
1
7
1
1
1
4
1
1
8
1
1
1
1
7
1
1
1
6
1
1
1
7
1
1
1
13
1...

output:

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

result:

ok Correct (117 test cases)

Test #18:

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

input:

105
7
1
1
1
11
1
1
1
1
1
13
1
1
1
1
1
1
12
1
1
1
1
1
1
6
1
1
1
10
1
0
0
0
0
1
1
7
1
1
1
4
1
1
13
1
0
0
0
0
0
0
1
1
13
1
0
0
0
0
0
0
1
1
14
1
1
1
1
1
1
1
5
1
1
6
1
0
0
1
1
4
1
0
1
1
6
1
1
1
6
1
1
1
10
1
0
0
0
0
1
1
15
1
1
1
1
1
1
1
6
1
1
1
9
1
1
1
1
13
1
1
1
1
1
1
15
1
0
0
0
0
0
0
0
1
1
5
1
0
0
1
1
1...

output:

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

result:

ok Correct (105 test cases)

Test #19:

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

input:

86
12
1
0
0
0
0
0
1
1
17
1
1
1
1
1
1
1
1
7
1
0
0
0
1
1
6
1
1
1
13
1
0
0
0
0
0
0
1
1
5
1
0
0
1
1
16
1
1
1
1
1
1
1
1
6
1
0
0
1
1
10
1
1
1
1
1
18
1
1
1
1
1
1
1
1
1
4
1
1
19
1
1
1
1
1
1
1
1
1
14
1
0
0
0
0
0
0
1
1
13
1
0
0
0
0
0
0
1
1
4
1
0
1
1
5
1
1
8
1
1
1
1
13
1
1
1
1
1
1
15
1
0
0
0
0
0
0
0
1
1
7
1
1
...

output:

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

result:

ok Correct (86 test cases)

Test #20:

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

input:

20
53
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
61
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
96
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
60
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
25
...

output:

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

result:

ok Correct (20 test cases)

Test #21:

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

input:

9
273
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
54
1
1
1
1
1
1
1
1
1
1...

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 69 70
? 71 72
? 73 74
? 75 76
? 77 ...

result:

ok Correct (9 test cases)

Test #22:

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

input:

12
92
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
50
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
395
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 69 70
? 71 72
? 73 74
? 75 76
? 77 ...

result:

ok Correct (12 test cases)

Test #23:

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

input:

5
957
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 69 70
? 71 72
? 73 74
? 75 76
? 77 ...

result:

ok Correct (5 test cases)

Test #24:

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

input:

81
11
1
1
1
1
1
20
0
1
0
0
0
0
0
0
0
0
1
1
5
1
0
0
0
1
1
16
0
0
1
0
0
0
1
1
19
1
0
0
0
0
0
0
0
0
0
1
1
17
1
0
0
0
0
0
0
0
0
1
1
12
1
0
1
0
0
0
4
1
0
1
1
13
0
0
1
0
0
0
0
0
1
0
20
1
0
0
0
0
0
0
0
0
0
0
1
1
10
1
1
0
0
1
20
1
1
0
1
1
1
1
1
0
1
8
1
0
1
1
5
0
0
1
0
0
11
1
0
0
0
1
17
1
1
1
1
1
1
1
0
9
0
1...

output:

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

result:

ok Correct (81 test cases)

Test #25:

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

input:

24
43
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
87
1
1
1
0
1
1
1
0
1
1
1
1
1
0
1
1
1
1
1
1
1
0
1
1
1
1
1
0
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
19
1
1
0
1
1
1
0
1
1
23
0
0
0
0
1
1
0
0
0
0
0
13
0
0
0
1
0
0
0
0
0
75
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
1
1
1
0
1
1
0
1
1
0
1
0
1
1
1
1
1
1
1
1
1
13
1
0
0
0
0
...

output:

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

result:

ok Correct (24 test cases)

Test #26:

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

input:

9
35
0
0
0
0
1
0
0
1
0
0
1
0
1
1
0
0
1
122
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
167
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0...

output:

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

result:

ok Correct (9 test cases)

Test #27:

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

input:

8
481
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 69 70
? 71 72
? 73 74
? 75 76
? 77 ...

result:

ok Correct (8 test cases)

Test #28:

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

input:

10
510
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0...

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 69 70
? 71 72
? 73 74
? 75 76
? 77 ...

result:

ok Correct (10 test cases)

Test #29:

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

input:

1
1000
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0...

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 69 70
? 71 72
? 73 74
? 75 76
? 77 ...

result:

ok Correct (1 test case)

Test #30:

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

input:

2
500
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 69 70
? 71 72
? 73 74
? 75 76
? 77 ...

result:

ok Correct (2 test cases)

Test #31:

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

input:

4
250
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
250
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 69 70
? 71 72
? 73 74
? 75 76
? 77 ...

result:

ok Correct (4 test cases)

Test #32:

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

input:

1
1000
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0...

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 69 70
? 71 72
? 73 74
? 75 76
? 77 ...

result:

ok Correct (1 test case)

Test #33:

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

input:

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

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 69 70
? 71 72
? 73 74
? 75 76
? 77 ...

result:

ok Correct (1 test case)

Test #34:

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

input:

1
1000
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0...

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 69 70
? 71 72
? 73 74
? 75 76
? 77 ...

result:

ok Correct (1 test case)

Test #35:

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

input:

2
500
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 69 70
? 71 72
? 73 74
? 75 76
? 77 ...

result:

ok Correct (2 test cases)

Test #36:

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

input:

2
500
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 69 70
? 71 72
? 73 74
? 75 76
? 77 ...

result:

ok Correct (2 test cases)

Test #37:

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

input:

2
500
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 69 70
? 71 72
? 73 74
? 75 76
? 77 ...

result:

ok Correct (2 test cases)

Test #38:

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

input:

4
250
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
1
250
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 69 70
? 71 72
? 73 74
? 75 76
? 77 ...

result:

ok Correct (4 test cases)

Test #39:

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

input:

4
250
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
250
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 69 70
? 71 72
? 73 74
? 75 76
? 77 ...

result:

ok Correct (4 test cases)

Test #40:

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

input:

4
250
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
250
0
0
0
0
1
0
1
1
0
0
1
1
1
0
1
1
1
...

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 69 70
? 71 72
? 73 74
? 75 76
? 77 ...

result:

ok Correct (4 test cases)

Test #41:

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

input:

1
1000
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0...

output:

? 1 2
? 3 4
? 5 6
? 7 8
? 9 10
? 11 12
? 13 14
? 15 16
? 17 18
? 19 20
? 21 22
? 23 24
? 25 26
? 27 28
? 29 30
? 31 32
? 33 34
? 35 36
? 37 38
? 39 40
? 41 42
? 43 44
? 45 46
? 47 48
? 49 50
? 51 52
? 53 54
? 55 56
? 57 58
? 59 60
? 61 62
? 63 64
? 65 66
? 67 68
? 69 70
? 71 72
? 73 74
? 75 76
? 77 ...

result:

ok Correct (1 test case)

Extra Test:

score: 0
Extra Test Passed