QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#661389#7804. Intersegment Activationucup-team1001#AC ✓10ms3884kbC++202.5kb2024-10-20 16:00:272024-10-20 16:00:28

Judging History

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

  • [2024-10-20 16:00:28]
  • 评测
  • 测评结果:AC
  • 用时:10ms
  • 内存:3884kb
  • [2024-10-20 16:00:27]
  • 提交

answer

#include "bits/stdc++.h"


using namespace std;
using i64 = long long;

const i64 mod = 1e9 + 7;
const i64 inf = 1e18;
//#define endl '\n'

i64 ask(int l, int t) {
    cout << l << " " << t << endl;
    i64 x;
    cin >> x;
    return x;
}

void solve() {
    int n;
    int sums;
    cin >> n >> sums;
    if(sums == n)return;
    vector<int> show(n + 1, 0);
    auto check = [&](int k, int p) {
//        cerr << "check" << endl;
        if (k == 0)return;
        for (int i = 1; i <= n; i++) {
            if (show[i] == 0) {
                int t = ask(i, i);
                if(t == n) exit(0);;
                if (t < p) {
                    show[i] = 1;
                    int ta = ask(i, i);
                    if(ta == n) exit(0);
                    p = ta;
                }
                if (t > p) {
                    show[i] = 1;
                    p = t;
                }
            }
        }
    };
    check(sums, sums);
    //获取所有的连续为0的区间
//   ;
    auto get = [&]() {
        vector<pair<int, int>> ans;
        for (int i = 1; i <= n; i++) {
            if (show[i] == 0) {
                int j = i;
                while (j <= n && show[j] == 0) {
                    j++;
                }
                ans.emplace_back(i, j - 1);
                i = j - 1;
            }
        }
//        cerr << "get" << endl;
//        for (auto [x, y]: ans) {
//            cerr << x << " " << y << endl;
//        }
        return ans;
    };
    vector<pair<int, int>> op;
    function<void(int, int)> dfs = [&](int l, int r) {
        if (l != r) {
            dfs(l, r - 1);
            auto z = op;
            op.emplace_back(l, r);
            for (auto [x, y]: z) {
                op.emplace_back(x, y);
            }
        }
        if (l == r) {
            op.emplace_back(l, r);
        }
    };
    auto x = get();
    while (!x.empty()) {
        auto [l, r] = x.back();
        op.clear();
//        cerr << "dfs " << l << " " << r << endl;
        dfs(l, r);

        for (auto [xx, yy]: op) {

            int t = ask(xx, yy);
            if (t == n)exit(0);;
            if (t != sums) {
                check(t - sums, t);
                x = get();
                sums = t;
                break;
            }
        }
    }


}

int main() {
//    ios::sync_with_stdio(false), cin.tie(0);
    int t = 1;
    while (t--) {
        solve();
    }
    return 0;
}

详细

Test #1:

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

input:

3
0
0
0
1
0
1
1
1
1
2
1
2
3

output:

1 1
1 2
1 1
1 1
1 1
2 2
3 3
2 2
2 3
2 2
2 2
3 3

result:

ok OK, 12 queries

Test #2:

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

input:

1
0
1

output:

1 1

result:

ok OK, 1 queries

Test #3:

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

input:

2
1
2

output:

1 1

result:

ok OK, 1 queries

Test #4:

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

input:

2
0
0
1
0
1
2

output:

1 1
1 2
1 1
1 1
2 2

result:

ok OK, 5 queries

Test #5:

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

input:

2
0
1
0
1
2

output:

1 1
1 1
1 1
2 2

result:

ok OK, 4 queries

Test #6:

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

input:

2
0
0
1
2

output:

1 1
1 2
1 1

result:

ok OK, 3 queries

Test #7:

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

input:

3
0
0
0
0
2
3

output:

1 1
1 2
1 1
1 3
1 1

result:

ok OK, 5 queries

Test #8:

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

input:

3
0
0
0
0
0
1
0
1
1
1
1
2
3

output:

1 1
1 2
1 1
1 3
1 1
1 1
1 1
2 2
3 3
2 2
2 3
2 2

result:

ok OK, 12 queries

Test #9:

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

input:

3
0
1
0
1
2
3

output:

1 1
1 1
1 1
2 2
3 3

result:

ok OK, 5 queries

Test #10:

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

input:

3
0
0
0
0
1
1
1
0
1
1
2
1
2
3

output:

1 1
1 2
1 1
1 3
1 1
2 2
3 3
3 3
1 1
1 2
1 1
1 1
2 2

result:

ok OK, 13 queries

Test #11:

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

input:

4
0
0
0
0
0
0
0
0
0
1
0
1
1
1
1
1
2
1
2
2
2
2
3
2
3
4

output:

1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 1
1 1
2 2
3 3
4 4
2 2
2 3
2 2
2 2
3 3
4 4
3 3
3 4
3 3
3 3
4 4

result:

ok OK, 25 queries

Test #12:

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

input:

4
0
0
0
0
0
0
0
0
0
0
1
0
1
1
1
1
1
1
1
2
1
2
2
2
2
3
2
3
4

output:

1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 1
2 2
3 3
4 4
2 2
2 3
2 2
2 4
2 2
2 2
3 3
4 4
3 3
3 4
3 3
3 3
4 4

result:

ok OK, 28 queries

Test #13:

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

input:

4
0
1
0
1
2
3
4

output:

1 1
1 1
1 1
2 2
3 3
4 4

result:

ok OK, 6 queries

Test #14:

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

input:

4
0
0
0
0
0
0
0
0
1
1
1
1
0
1
1
1
1
1
1
2
1
2
3
4

output:

1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
2 2
3 3
4 4
4 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 1
2 2
3 3

result:

ok OK, 23 queries

Test #15:

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

input:

5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
1
1
1
1
1
2
3
2
3
3
3
3
3
3
3
5

output:

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

result:

ok OK, 37 queries

Test #16:

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

input:

5
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
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
2
2
2
2
2
2
2
2
3
2
3
3
3
3
4
5

output:

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

result:

ok OK, 55 queries

Test #17:

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

input:

5
0
1
0
1
2
3
4
5

output:

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

result:

ok OK, 7 queries

Test #18:

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

input:

5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
2
3
4
5

output:

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

result:

ok OK, 41 queries

Test #19:

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

input:

6
0
0
0
0
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
2
2
2
2
2
2
2
2
2
2
3
2
3
3
3
3
3
3
3
3
4
3
4
4
4
4
6

output:

1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 1
2 2
3 3
4 4
5 5
6 6
2 2
2 3
2 2
2 4
2 2
2 3
2 2
2 5
2 2
2 3
2 2
2 4
2 2
2 3
2 2
2 6
2 2
2 3
2 2
2 4
2 2
2 3
2 2
2 5
2 2
2 3
2 2
2 4
2 2
2 3
2 2
2 2
3 3
4 4
5 5
6 6
3 3
3 4
3 3
3 5
...

result:

ok OK, 93 queries

Test #20:

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

input:

6
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
2
3
3
3
3
3
3
3
4
3
4
4
4
4
5
4
5
6

output:

1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 6
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 1
2 2
3 3
4 4
5 5
6 6
2 2
2 3
2 2
2 4
2 2
2 3
2 2
2 5
2 2
2 3
2 2
2 4
2 2
2 3
2 2
2 6
2 2
2 3
2 2
2 4
2 2
2 2
3 3
4 4
5 5
6 6
...

result:

ok OK, 103 queries

Test #21:

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

input:

6
0
1
0
1
2
3
4
5
6

output:

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

result:

ok OK, 8 queries

Test #22:

score: 0
Accepted
time: 1ms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2 4
2 2
2 3
2 2
2 5
2 2
2 3
2 2
2 4
2 2
2 3
2 2
2 6
2 2
2 3
2 2
2 4
2 2
2 3
2 2
2 5
2 2
2 3
2 2
2 4
...

result:

ok OK, 159 queries

Test #24:

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

input:

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

output:

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

result:

ok OK, 198 queries

Test #25:

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

input:

7
0
1
0
1
2
3
4
5
6
7

output:

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

result:

ok OK, 9 queries

Test #26:

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

input:

7
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0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1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 7
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
...

result:

ok OK, 238 queries

Test #28:

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

input:

8
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 6
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 7
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
...

result:

ok OK, 374 queries

Test #29:

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

input:

8
0
1
0
1
2
3
4
5
6
7
8

output:

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

result:

ok OK, 10 queries

Test #30:

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

input:

8
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0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2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 7
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
...

result:

ok OK, 580 queries

Test #32:

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

input:

9
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 6
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 7
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
...

result:

ok OK, 729 queries

Test #33:

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

input:

9
0
1
0
1
2
3
4
5
6
7
8
9

output:

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

result:

ok OK, 11 queries

Test #34:

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

input:

9
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0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 3
1 1
1 2
1 1
1 6
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 7
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
...

result:

ok OK, 1486 queries

Test #36:

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

input:

10
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 6
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 7
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
...

result:

ok OK, 1417 queries

Test #37:

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

input:

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

output:

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

result:

ok OK, 12 queries

Test #38:

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

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 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 6
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 7
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
...

result:

ok OK, 704 queries

Test #40:

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

input:

10
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 6
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 7
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
...

result:

ok OK, 2094 queries

Test #41:

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

input:

10
0
0
0
0
0
0
0
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2...

output:

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

result:

ok OK, 249 queries

Test #42:

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

input:

10
6
5
6
5
6
5
6
7
6
7
6
7
7
7
7
6
7
7
7
7
7
7
7
7
7
7
9
8
9
8
9
10

output:

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

result:

ok OK, 31 queries

Test #43:

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

input:

10
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0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 1
1 2
1 1
1 4
1 1
1 2
1 1
...

result:

ok OK, 1133 queries

Test #45:

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

input:

10
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
2
1
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2...

output:

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

result:

ok OK, 332 queries

Test #46:

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

input:

10
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
3
3
3
3
3
3
2
3
3
3
3
4
4
4
4
4
4...

output:

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

result:

ok OK, 189 queries

Test #47:

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

input:

10
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 6
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 7
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
...

result:

ok OK, 470 queries

Test #48:

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

input:

10
0
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 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 6
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 7
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
...

result:

ok OK, 1223 queries

Test #50:

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

input:

10
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 6
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 7
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
...

result:

ok OK, 1057 queries

Test #51:

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

input:

10
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0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 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 7
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
...

result:

ok OK, 725 queries

Test #53:

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

input:

10
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 6
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 7
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
...

result:

ok OK, 1082 queries

Test #54:

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

input:

10
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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2
1 1
1 3
1 1
1 2
1 1
1 7
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
...

result:

ok OK, 1114 queries

Test #56:

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

input:

10
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 6
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 7
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
...

result:

ok OK, 1481 queries

Test #57:

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

input:

10
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 962 queries

Test #59:

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

input:

10
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 6
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 7
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
...

result:

ok OK, 1413 queries

Test #60:

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

input:

10
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 6
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 7
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
...

result:

ok OK, 1703 queries

Test #61:

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

input:

10
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 6
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 7
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
...

result:

ok OK, 1501 queries

Test #62:

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

input:

10
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0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
1 1
1 3
1 1
1 2
1 1
1 6
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 7
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
...

result:

ok OK, 1421 queries

Test #64:

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

input:

10
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 6
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 7
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
...

result:

ok OK, 1356 queries

Test #65:

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

input:

10
9
10

output:

1 1

result:

ok OK, 1 queries

Test #66:

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

input:

10
9
8
9
8
9
8
9
8
9
8
9
8
9
8
9
8
9
8
9
10

output:

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

result:

ok OK, 19 queries

Test #67:

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

input:

10
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
10 10
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 6
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 5
1 1
1 2
1 1
1 3
1 1
1 2
1 1
1 4
1 1
1 2
1 1
1 3
1 1
1 2
1 1
...

result:

ok OK, 531 queries

Test #68:

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

input:

10
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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ra Test Passed