QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#143068#4565. Rarest Insectsbashkort#57.41 30ms4204kbC++175.2kb2023-08-20 15:05:042024-07-04 01:50:21

Judging History

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

  • [2024-07-04 01:50:21]
  • 评测
  • 测评结果:57.41
  • 用时:30ms
  • 内存:4204kb
  • [2023-08-20 15:05:04]
  • 提交

answer

#include "insects.h"
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

int min_cardinality(int N) {
    vector<int> a(N);
    iota(a.begin(), a.end(), 0);
    shuffle(a.begin(), a.end(), rnd);
    
    vector<int> leaders, inside(N);
    int maxSize = 0, T = 0, lastQueryT = 0;
    int queriesCnt[3]{};

    auto insert = [&](int x) -> void {
        if (inside[x]) {
            return;
        }
        move_inside(x);
        T += 1;
        queriesCnt[0] += 1;
        inside[x] = true;
    };

    auto erase = [&](int x) -> void {
        if (!inside[x]) {
            return;
        }
        move_outside(x);
        T += 1;
        queriesCnt[1] += 1;
        inside[x] = false;
    };

    auto query = [&]() -> int {
        if (T == lastQueryT) {
            return maxSize;
        }
        lastQueryT = T;
        queriesCnt[2] += 1;
        return maxSize = press_button();
    };

    vector<int> others, lo(N, -1), hi(N, -1);

    for (int x : a) {
        insert(x);
        if (query() == 1) {
            leaders.push_back(x);
        } else {
            others.push_back(x);
            lo[x] = -1, hi[x] = size(leaders) - 1;
            erase(x);
        }
    };

    int ans = N;

    int minPos = 0, maxPos = size(leaders), full = true;
    int m = size(leaders);
    vector<vector<int>> queries(m);
    vector<int> siz(m);

    while (true) {
        for (int i = 0; i < m; ++i) {
            queries[i].clear();
        }
        minPos = N, maxPos = 0;
        for (int i = 0; i < N; ++i) {
            if (lo[i] + 1 < hi[i]) {
                int mid = lo[i] + hi[i] >> 1;
                minPos = min(minPos, mid), maxPos = max(maxPos, mid);
                queries[lo[i] + hi[i] >> 1].push_back(i);
            }
        }
        if (minPos > maxPos) {
            break;
        }
        full = rnd() % 2;
        if (full) {
            for (int i = m - 1; i > maxPos; --i) {
                erase(leaders[i]);
            }
            for (int i = 0; i <= maxPos; ++i) {
                insert(leaders[i]);
            }
            for (int i = maxPos; i >= minPos; --i) {
                for (int x : queries[i]) {
                    insert(x);
                    if (query() == 2) {
                        hi[x] = i;
                        if (lo[x] + 1 < hi[x]) {
                            int mid = lo[x] + hi[x] >> 1;
                            if (mid >= minPos) {
                                queries[mid].push_back(x);
                            }
                        }
                    } else {
                        lo[x] = i;
                    }
                    erase(x);
                }
                if (i > minPos) {
                    erase(leaders[i]);
                }
            }
            full = false;
        } else {
            for (int i = m - 1; i > minPos; --i) {
                erase(leaders[i]);
            }
            for (int i = 0; i < minPos; ++i) {
                insert(leaders[i]);
            }
            for (int i = minPos; i <= maxPos; ++i) {
                insert(leaders[i]);
                for (int x : queries[i]) {
                    insert(x);
                    if (query() == 2) {
                        hi[x] = i;
                    } else {
                        lo[x] = i;
                        if (lo[x] + 1 < hi[x]) {
                            int mid = lo[x] + hi[x] >> 1;
                            if (mid <= maxPos) {
                                queries[mid].push_back(x);
                            }
                        }
                    }
                    erase(x);
                }
            }
            full = true;
        }
    }

    for (int i = 0; i < N; ++i) {
        if (hi[i] != -1) {
            siz[hi[i]] += 1;
        }
    }

    for (int i = 0; i < m; ++i) {
        ans = min(ans, 1 + siz[i]);
    }

    auto dfs = [&](auto dfs, vector<int> lead, vector<int> oth, int isFull) -> void {
        if (ans == 1) {
            return;
        }
        if (size(lead) == 1) {
            ans = min<int>(ans, 1 + size(oth));
            return;
        }
        if (size(lead) > size(oth)) {
            ans = 1;
            return;
        }
        int mid = size(lead) / 2;
        vector<int> leadLeft(lead.begin(), lead.begin() + mid);
        vector<int> leadRight(lead.begin() + mid, lead.end());
        vector<int> nxt[2];
        if (isFull) {
            for (int x : leadRight) {
                erase(x);
            }
        } else {
            for (int x : leadLeft) {
                insert(x);
            }
        }
        for (int x : oth) {
            insert(x);
            if (query() == 1) {
                nxt[1].push_back(x);
            } else {
                nxt[0].push_back(x);
            }
            erase(x);
        }
        dfs(dfs, leadLeft, nxt[0], true);
        dfs(dfs, leadRight, nxt[1], false);
    };

    // dfs(dfs, leaders, others, true);

    return ans;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 1ms
memory: 3804kb

input:

6
1
1
2
2
1
2
1
2
2

output:

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

result:

ok 

Test #2:

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

input:

2
1
2

output:

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

result:

ok 

Test #3:

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

input:

2
1
1

output:

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

result:

ok 

Test #4:

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

input:

3
1
1
2
2

output:

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

result:

ok 

Test #5:

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

input:

5
1
2
1
2
2
2
1

output:

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

result:

ok 

Test #6:

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

input:

8
1
1
2
1
2
2
2
2
2
1
1
1
1
2
2
2
2

output:

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

result:

ok 

Test #7:

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

input:

199
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
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:

8
0 162
8
2
8
0 32
8
2
8
1 32
8
0 156
8
2
8
1 156
8
0 168
8
2
8
1 168
8
0 65
8
2
8
1 65
8
0 91
8
2
8
1 91
8
0 166
8
2
8
1 166
8
0 57
8
2
8
1 57
8
0 183
8
2
8
1 183
8
0 80
8
2
8
1 80
8
0 103
8
2
8
1 103
8
0 96
8
2
8
1 96
8
0 147
8
2
8
1 147
8
0 12
8
2
8
1 12
8
0 87
8
2
8
1 87
8
0 145
8
2
8
1 145
8
0 ...

result:

ok 

Test #8:

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

input:

200
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

8
0 61
8
2
8
0 37
8
2
8
0 82
8
2
8
0 28
8
2
8
0 128
8
2
8
0 169
8
2
8
0 194
8
2
8
0 121
8
2
8
0 144
8
2
8
0 138
8
2
8
0 12
8
2
8
0 116
8
2
8
0 31
8
2
8
0 18
8
2
8
0 0
8
2
8
0 64
8
2
8
0 125
8
2
8
0 86
8
2
8
0 185
8
2
8
0 16
8
2
8
0 49
8
2
8
0 4
8
2
8
0 11
8
2
8
0 107
8
2
8
0 83
8
2
8
0 22
8
2
8
0 17...

result:

ok 

Test #9:

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

input:

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

output:

8
0 107
8
2
8
0 141
8
2
8
0 142
8
2
8
0 21
8
2
8
1 21
8
0 84
8
2
8
0 161
8
2
8
0 19
8
2
8
1 19
8
0 120
8
2
8
1 120
8
0 7
8
2
8
1 7
8
0 75
8
2
8
0 26
8
2
8
0 102
8
2
8
1 102
8
0 149
8
2
8
0 67
8
2
8
0 86
8
2
8
0 199
8
2
8
1 199
8
0 82
8
2
8
1 82
8
0 97
8
2
8
1 97
8
0 151
8
2
8
0 83
8
2
8
0 127
8
2
8
...

result:

ok 

Test #10:

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

input:

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

output:

8
0 106
8
2
8
0 71
8
2
8
0 140
8
2
8
0 126
8
2
8
0 195
8
2
8
0 43
8
2
8
0 46
8
2
8
1 46
8
0 171
8
2
8
0 62
8
2
8
1 62
8
0 59
8
2
8
1 59
8
0 89
8
2
8
0 157
8
2
8
0 72
8
2
8
1 72
8
0 22
8
2
8
1 22
8
0 174
8
2
8
1 174
8
0 193
8
2
8
1 193
8
0 110
8
2
8
0 179
8
2
8
0 60
8
2
8
0 132
8
2
8
1 132
8
0 17
8
2...

result:

ok 

Test #11:

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

input:

199
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
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:

8
0 93
8
2
8
0 133
8
2
8
1 133
8
0 23
8
2
8
1 23
8
0 140
8
2
8
1 140
8
0 37
8
2
8
1 37
8
0 149
8
2
8
1 149
8
0 75
8
2
8
1 75
8
0 103
8
2
8
1 103
8
0 187
8
2
8
1 187
8
0 185
8
2
8
1 185
8
0 35
8
2
8
1 35
8
0 172
8
2
8
1 172
8
0 16
8
2
8
1 16
8
0 3
8
2
8
1 3
8
0 49
8
2
8
1 49
8
0 38
8
2
8
1 38
8
0 80
...

result:

ok 

Test #12:

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

input:

197
1
2
2
1
1
1
1
1
1
1
2
1
2
1
2
2
2
2
1
1
1
1
2
1
1
2
1
2
2
1
2
1
1
2
1
2
1
2
2
1
2
2
1
2
1
2
2
1
1
2
1
1
1
2
1
1
2
2
1
1
1
2
2
1
2
1
1
2
1
2
1
2
1
2
1
2
1
2
2
2
1
2
2
1
2
2
1
1
1
1
2
1
1
1
2
1
2
2
2
1
1
1
2
1
2
2
2
2
1
2
1
2
1
1
1
2
2
2
2
1
1
1
2
1
2
2
2
1
2
1
2
1
2
1
2
2
2
2
2
1
2
2
2
1
2
1
2
1
...

output:

8
0 97
8
2
8
0 113
8
2
8
1 113
8
0 72
8
2
8
1 72
8
0 189
8
2
8
0 82
8
2
8
0 148
8
2
8
0 79
8
2
8
0 4
8
2
8
0 101
8
2
8
0 23
8
2
8
0 131
8
2
8
1 131
8
0 195
8
2
8
0 187
8
2
8
1 187
8
0 106
8
2
8
0 152
8
2
8
1 152
8
0 163
8
2
8
1 163
8
0 34
8
2
8
1 34
8
0 139
8
2
8
1 139
8
0 128
8
2
8
0 70
8
2
8
0 157...

result:

ok 

Test #13:

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

input:

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

output:

8
0 165
8
2
8
0 128
8
2
8
0 103
8
2
8
1 103
8
0 127
8
2
8
0 104
8
2
8
0 164
8
2
8
1 164
8
0 179
8
2
8
1 179
8
0 140
8
2
8
1 140
8
0 40
8
2
8
1 40
8
0 52
8
2
8
1 52
8
0 12
8
2
8
1 12
8
0 60
8
2
8
1 60
8
0 36
8
2
8
1 36
8
0 48
8
2
8
1 48
8
0 115
8
2
8
1 115
8
0 141
8
2
8
1 141
8
0 93
8
2
8
1 93
8
0 56...

result:

ok 

Test #14:

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

input:

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

output:

8
0 105
8
2
8
0 20
8
2
8
1 20
8
0 185
8
2
8
0 136
8
2
8
1 136
8
0 27
8
2
8
0 80
8
2
8
0 32
8
2
8
0 190
8
2
8
0 117
8
2
8
1 117
8
0 33
8
2
8
1 33
8
0 14
8
2
8
1 14
8
0 41
8
2
8
1 41
8
0 85
8
2
8
0 56
8
2
8
0 184
8
2
8
0 96
8
2
8
1 96
8
0 64
8
2
8
0 103
8
2
8
1 103
8
0 43
8
2
8
1 43
8
0 155
8
2
8
0 54...

result:

ok 

Test #15:

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

input:

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

output:

8
0 105
8
2
8
0 10
8
2
8
0 197
8
2
8
0 146
8
2
8
1 146
8
0 15
8
2
8
1 15
8
0 46
8
2
8
1 46
8
0 101
8
2
8
1 101
8
0 19
8
2
8
1 19
8
0 87
8
2
8
1 87
8
0 152
8
2
8
1 152
8
0 6
8
2
8
1 6
8
0 161
8
2
8
1 161
8
0 25
8
2
8
0 195
8
2
8
1 195
8
0 40
8
2
8
1 40
8
0 14
8
2
8
1 14
8
0 173
8
2
8
0 186
8
2
8
1 18...

result:

ok 

Test #16:

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

input:

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

output:

8
0 134
8
2
8
0 49
8
2
8
1 49
8
0 178
8
2
8
0 115
8
2
8
0 75
8
2
8
1 75
8
0 92
8
2
8
0 182
8
2
8
0 39
8
2
8
0 168
8
2
8
1 168
8
0 193
8
2
8
1 193
8
0 7
8
2
8
1 7
8
0 55
8
2
8
1 55
8
0 11
8
2
8
0 195
8
2
8
1 195
8
0 67
8
2
8
1 67
8
0 161
8
2
8
0 180
8
2
8
1 180
8
0 64
8
2
8
1 64
8
0 2
8
2
8
1 2
8
0 3...

result:

ok 

Test #17:

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

input:

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

output:

8
0 126
8
2
8
0 60
8
2
8
0 77
8
2
8
0 192
8
2
8
1 192
8
0 128
8
2
8
1 128
8
0 70
8
2
8
0 59
8
2
8
1 59
8
0 19
8
2
8
1 19
8
0 96
8
2
8
0 33
8
2
8
1 33
8
0 183
8
2
8
1 183
8
0 194
8
2
8
1 194
8
0 94
8
2
8
0 155
8
2
8
0 154
8
2
8
1 154
8
0 64
8
2
8
1 64
8
0 87
8
2
8
1 87
8
0 182
8
2
8
1 182
8
0 156
8
2...

result:

ok 

Test #18:

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

input:

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

output:

8
0 162
8
2
8
0 187
8
2
8
0 35
8
2
8
0 175
8
2
8
1 175
8
0 105
8
2
8
1 105
8
0 154
8
2
8
0 163
8
2
8
0 6
8
2
8
0 29
8
2
8
1 29
8
0 88
8
2
8
0 136
8
2
8
1 136
8
0 78
8
2
8
1 78
8
0 65
8
2
8
1 65
8
0 93
8
2
8
0 107
8
2
8
0 2
8
2
8
1 2
8
0 48
8
2
8
1 48
8
0 117
8
2
8
0 26
8
2
8
1 26
8
0 43
8
2
8
1 43
8...

result:

ok 

Test #19:

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

input:

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

output:

8
0 121
8
2
8
0 192
8
2
8
0 88
8
2
8
0 150
8
2
8
0 153
8
2
8
1 153
8
0 13
8
2
8
0 84
8
2
8
1 84
8
0 80
8
2
8
0 66
8
2
8
1 66
8
0 125
8
2
8
0 57
8
2
8
1 57
8
0 195
8
2
8
1 195
8
0 38
8
2
8
1 38
8
0 81
8
2
8
1 81
8
0 68
8
2
8
1 68
8
0 5
8
2
8
0 36
8
2
8
1 36
8
0 100
8
2
8
0 76
8
2
8
0 75
8
2
8
1 75
8
...

result:

ok 

Test #20:

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

input:

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

output:

8
0 155
8
2
8
0 180
8
2
8
0 43
8
2
8
0 195
8
2
8
0 187
8
2
8
0 171
8
2
8
0 9
8
2
8
0 145
8
2
8
0 70
8
2
8
0 108
8
2
8
1 108
8
0 129
8
2
8
1 129
8
0 127
8
2
8
0 172
8
2
8
0 124
8
2
8
1 124
8
0 143
8
2
8
1 143
8
0 149
8
2
8
1 149
8
0 66
8
2
8
1 66
8
0 78
8
2
8
0 144
8
2
8
0 164
8
2
8
0 81
8
2
8
0 185
...

result:

ok 

Test #21:

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

input:

200
1
1
1
1
1
1
2
2
1
2
1
1
1
1
1
1
1
1
2
1
2
1
1
1
1
2
1
1
2
1
2
2
1
2
1
2
2
1
1
2
2
2
2
1
2
1
2
1
2
2
2
2
2
1
1
2
1
2
2
2
2
2
1
2
1
2
1
1
2
2
2
2
2
2
2
1
2
2
1
1
2
2
2
2
2
2
2
1
2
1
2
1
2
2
1
2
1
2
2
1
1
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
...

output:

8
0 113
8
2
8
0 114
8
2
8
0 38
8
2
8
0 32
8
2
8
0 13
8
2
8
0 100
8
2
8
0 103
8
2
8
1 103
8
0 132
8
2
8
1 132
8
0 70
8
2
8
0 160
8
2
8
1 160
8
0 107
8
2
8
0 37
8
2
8
0 119
8
2
8
0 44
8
2
8
0 198
8
2
8
0 78
8
2
8
0 183
8
2
8
0 188
8
2
8
0 85
8
2
8
1 85
8
0 63
8
2
8
0 71
8
2
8
1 71
8
0 123
8
2
8
0 94
8...

result:

ok 

Test #22:

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

input:

199
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
2
2
1
2
1
1
2
1
1
2
1
1
1
1
2
2
2
2
1
2
1
2
2
2
1
2
2
1
1
2
1
1
1
2
2
1
2
2
2
1
2
2
2
2
1
2
2
2
2
2
2
1
2
1
1
2
2
1
2
2
2
2
2
1
2
2
1
2
1
2
1
2
2
2
2
2
2
2
2
2
2
1
2
2
2
1
2
2
1
1
2
1
1
1
2
2
2
2
1
1
2
2
1
2
2
2
2
1
1
...

output:

8
0 14
8
2
8
0 28
8
2
8
0 173
8
2
8
0 11
8
2
8
0 27
8
2
8
0 21
8
2
8
0 44
8
2
8
0 113
8
2
8
0 179
8
2
8
0 60
8
2
8
0 104
8
2
8
0 136
8
2
8
0 26
8
2
8
0 153
8
2
8
0 25
8
2
8
0 141
8
2
8
0 82
8
2
8
0 9
8
2
8
0 15
8
2
8
1 15
8
0 164
8
2
8
0 196
8
2
8
0 69
8
2
8
0 121
8
2
8
0 150
8
2
8
0 5
8
2
8
0 75
8
...

result:

ok 

Test #23:

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

input:

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

output:

8
0 37
8
2
8
0 14
8
2
8
0 193
8
2
8
0 104
8
2
8
0 166
8
2
8
0 59
8
2
8
0 53
8
2
8
0 151
8
2
8
0 169
8
2
8
0 80
8
2
8
0 154
8
2
8
0 49
8
2
8
0 42
8
2
8
0 11
8
2
8
0 1
8
2
8
0 31
8
2
8
0 117
8
2
8
0 111
8
2
8
0 61
8
2
8
0 26
8
2
8
0 66
8
2
8
0 22
8
2
8
0 19
8
2
8
0 174
8
2
8
0 134
8
2
8
0 99
8
2
8
0 8...

result:

ok 

Subtask #2:

score: 15
Accepted

Test #24:

score: 15
Accepted
time: 0ms
memory: 3964kb

input:

1000
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
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:

8
0 230
8
2
8
0 142
8
2
8
1 142
8
0 391
8
2
8
1 391
8
0 543
8
2
8
1 543
8
0 572
8
2
8
1 572
8
0 276
8
2
8
1 276
8
0 201
8
2
8
1 201
8
0 905
8
2
8
1 905
8
0 7
8
2
8
1 7
8
0 343
8
2
8
1 343
8
0 734
8
2
8
1 734
8
0 93
8
2
8
1 93
8
0 653
8
2
8
1 653
8
0 737
8
2
8
1 737
8
0 459
8
2
8
1 459
8
0 690
8
2
8
...

result:

ok 

Test #25:

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

input:

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

output:

8
0 264
8
2
8
0 176
8
2
8
0 304
8
2
8
0 821
8
2
8
0 330
8
2
8
0 65
8
2
8
0 795
8
2
8
0 51
8
2
8
0 927
8
2
8
0 358
8
2
8
0 875
8
2
8
0 278
8
2
8
0 581
8
2
8
0 844
8
2
8
0 450
8
2
8
0 340
8
2
8
0 173
8
2
8
0 248
8
2
8
0 975
8
2
8
0 467
8
2
8
0 601
8
2
8
0 547
8
2
8
0 872
8
2
8
0 128
8
2
8
0 353
8
2
8
...

result:

ok 

Test #26:

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

input:

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

output:

8
0 346
8
2
8
0 404
8
2
8
0 72
8
2
8
0 726
8
2
8
0 916
8
2
8
0 886
8
2
8
0 714
8
2
8
0 979
8
2
8
0 443
8
2
8
1 443
8
0 884
8
2
8
0 497
8
2
8
0 814
8
2
8
0 997
8
2
8
1 997
8
0 653
8
2
8
0 406
8
2
8
0 416
8
2
8
1 416
8
0 3
8
2
8
1 3
8
0 670
8
2
8
0 68
8
2
8
1 68
8
0 358
8
2
8
0 402
8
2
8
0 843
8
2
8
0...

result:

ok 

Test #27:

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

input:

999
1
1
1
1
2
1
2
1
1
1
2
1
1
1
1
1
2
1
1
1
1
1
2
2
2
1
2
1
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
1
2
1
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
1
2
1
2
2
2
2
2
1
2
2
2
1
2
2
2
2
2
2
2
2
2
1
2
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
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:

8
0 720
8
2
8
0 694
8
2
8
0 75
8
2
8
0 263
8
2
8
0 744
8
2
8
1 744
8
0 562
8
2
8
0 700
8
2
8
1 700
8
0 62
8
2
8
0 679
8
2
8
0 678
8
2
8
0 559
8
2
8
1 559
8
0 30
8
2
8
0 164
8
2
8
0 860
8
2
8
0 160
8
2
8
0 122
8
2
8
0 242
8
2
8
1 242
8
0 883
8
2
8
0 45
8
2
8
0 642
8
2
8
0 809
8
2
8
0 641
8
2
8
0 128
...

result:

ok 

Test #28:

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

input:

996
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
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:

8
0 483
8
2
8
0 193
8
2
8
1 193
8
0 69
8
2
8
1 69
8
0 932
8
2
8
1 932
8
0 456
8
2
8
1 456
8
0 775
8
2
8
1 775
8
0 291
8
2
8
1 291
8
0 772
8
2
8
1 772
8
0 857
8
2
8
1 857
8
0 90
8
2
8
1 90
8
0 200
8
2
8
1 200
8
0 120
8
2
8
1 120
8
0 622
8
2
8
1 622
8
0 107
8
2
8
1 107
8
0 444
8
2
8
1 444
8
0 350
8
2
...

result:

ok 

Test #29:

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

input:

995
1
1
2
1
1
1
2
2
1
2
1
1
1
1
1
2
2
1
1
2
1
2
1
1
2
2
2
1
2
2
1
2
2
2
2
1
2
2
2
1
1
1
2
1
2
2
1
2
1
1
1
2
1
2
1
2
1
1
1
2
1
1
1
2
1
2
1
2
2
2
1
2
2
2
1
1
2
1
1
2
2
1
1
2
2
2
2
2
2
2
1
2
2
2
1
2
1
2
1
1
1
1
2
1
2
1
2
1
2
2
1
2
2
2
2
1
2
1
1
1
2
1
2
1
2
1
2
2
2
2
1
1
1
2
2
1
1
1
1
2
2
2
1
2
1
2
2
2
...

output:

8
0 597
8
2
8
0 437
8
2
8
0 741
8
2
8
1 741
8
0 918
8
2
8
0 37
8
2
8
0 211
8
2
8
0 6
8
2
8
1 6
8
0 331
8
2
8
1 331
8
0 930
8
2
8
0 479
8
2
8
1 479
8
0 898
8
2
8
0 435
8
2
8
0 404
8
2
8
0 812
8
2
8
0 45
8
2
8
0 116
8
2
8
1 116
8
0 189
8
2
8
1 189
8
0 821
8
2
8
0 954
8
2
8
0 59
8
2
8
1 59
8
0 405
8
2
...

result:

ok 

Test #30:

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

input:

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

output:

8
0 501
8
2
8
0 313
8
2
8
1 313
8
0 274
8
2
8
0 457
8
2
8
0 716
8
2
8
1 716
8
0 879
8
2
8
1 879
8
0 603
8
2
8
1 603
8
0 299
8
2
8
1 299
8
0 957
8
2
8
1 957
8
0 251
8
2
8
1 251
8
0 368
8
2
8
1 368
8
0 949
8
2
8
1 949
8
0 1
8
2
8
1 1
8
0 672
8
2
8
1 672
8
0 568
8
2
8
0 241
8
2
8
1 241
8
0 81
8
2
8
1 8...

result:

ok 

Test #31:

score: 0
Accepted
time: 11ms
memory: 3840kb

input:

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

output:

8
0 792
8
2
8
0 53
8
2
8
0 147
8
2
8
0 665
8
2
8
0 716
8
2
8
0 110
8
2
8
0 549
8
2
8
1 549
8
0 18
8
2
8
0 355
8
2
8
0 515
8
2
8
0 94
8
2
8
0 232
8
2
8
0 725
8
2
8
0 324
8
2
8
1 324
8
0 384
8
2
8
0 328
8
2
8
0 498
8
2
8
1 498
8
0 695
8
2
8
0 770
8
2
8
0 694
8
2
8
0 506
8
2
8
1 506
8
0 724
8
2
8
1 724...

result:

ok 

Test #32:

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

input:

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

output:

8
0 452
8
2
8
0 415
8
2
8
0 168
8
2
8
0 643
8
2
8
1 643
8
0 487
8
2
8
0 647
8
2
8
1 647
8
0 467
8
2
8
1 467
8
0 154
8
2
8
0 559
8
2
8
1 559
8
0 505
8
2
8
1 505
8
0 525
8
2
8
1 525
8
0 93
8
2
8
1 93
8
0 856
8
2
8
1 856
8
0 685
8
2
8
1 685
8
0 19
8
2
8
1 19
8
0 855
8
2
8
1 855
8
0 730
8
2
8
1 730
8
0 ...

result:

ok 

Test #33:

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

input:

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

output:

8
0 118
8
2
8
0 488
8
2
8
0 511
8
2
8
0 725
8
2
8
0 467
8
2
8
0 70
8
2
8
1 70
8
0 146
8
2
8
0 847
8
2
8
1 847
8
0 968
8
2
8
1 968
8
0 124
8
2
8
1 124
8
0 172
8
2
8
1 172
8
0 792
8
2
8
1 792
8
0 441
8
2
8
0 917
8
2
8
1 917
8
0 901
8
2
8
1 901
8
0 717
8
2
8
1 717
8
0 371
8
2
8
1 371
8
0 443
8
2
8
1 44...

result:

ok 

Test #34:

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

input:

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

output:

8
0 585
8
2
8
0 723
8
2
8
0 222
8
2
8
0 780
8
2
8
0 217
8
2
8
1 217
8
0 891
8
2
8
0 714
8
2
8
0 271
8
2
8
0 395
8
2
8
1 395
8
0 270
8
2
8
1 270
8
0 112
8
2
8
1 112
8
0 21
8
2
8
1 21
8
0 686
8
2
8
0 512
8
2
8
1 512
8
0 176
8
2
8
1 176
8
0 708
8
2
8
1 708
8
0 734
8
2
8
1 734
8
0 858
8
2
8
1 858
8
0 75...

result:

ok 

Test #35:

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

input:

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

output:

8
0 688
8
2
8
0 887
8
2
8
0 264
8
2
8
0 561
8
2
8
0 759
8
2
8
0 471
8
2
8
1 471
8
0 938
8
2
8
0 150
8
2
8
1 150
8
0 225
8
2
8
1 225
8
0 339
8
2
8
0 889
8
2
8
0 928
8
2
8
1 928
8
0 266
8
2
8
0 209
8
2
8
1 209
8
0 31
8
2
8
1 31
8
0 559
8
2
8
1 559
8
0 270
8
2
8
1 270
8
0 545
8
2
8
1 545
8
0 502
8
2
8
...

result:

ok 

Test #36:

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

input:

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

output:

8
0 923
8
2
8
0 9
8
2
8
0 899
8
2
8
0 442
8
2
8
0 114
8
2
8
0 70
8
2
8
0 268
8
2
8
0 443
8
2
8
0 880
8
2
8
1 880
8
0 41
8
2
8
0 812
8
2
8
0 751
8
2
8
1 751
8
0 835
8
2
8
1 835
8
0 398
8
2
8
1 398
8
0 836
8
2
8
1 836
8
0 602
8
2
8
1 602
8
0 79
8
2
8
1 79
8
0 102
8
2
8
1 102
8
0 57
8
2
8
1 57
8
0 104
...

result:

ok 

Test #37:

score: 0
Accepted
time: 11ms
memory: 4108kb

input:

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

output:

8
0 215
8
2
8
0 449
8
2
8
0 967
8
2
8
0 482
8
2
8
0 197
8
2
8
0 34
8
2
8
0 153
8
2
8
0 610
8
2
8
0 483
8
2
8
0 683
8
2
8
1 683
8
0 861
8
2
8
1 861
8
0 410
8
2
8
1 410
8
0 175
8
2
8
0 669
8
2
8
1 669
8
0 262
8
2
8
0 765
8
2
8
0 511
8
2
8
1 511
8
0 338
8
2
8
1 338
8
0 413
8
2
8
1 413
8
0 548
8
2
8
0 7...

result:

ok 

Test #38:

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

input:

997
1
1
1
1
1
1
1
1
1
2
2
1
1
1
1
1
2
1
2
1
1
1
1
1
2
1
1
1
2
2
1
2
1
2
2
2
1
1
1
1
2
1
2
2
1
2
2
2
1
2
1
2
2
1
2
1
1
2
2
2
2
2
1
2
2
2
2
2
2
2
2
1
1
2
1
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
1
2
2
2
1
2
2
2
2
2
2
2
2
2
2
1
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
...

output:

8
0 608
8
2
8
0 178
8
2
8
0 185
8
2
8
0 936
8
2
8
0 666
8
2
8
0 280
8
2
8
0 754
8
2
8
0 804
8
2
8
0 418
8
2
8
0 165
8
2
8
1 165
8
0 428
8
2
8
1 428
8
0 807
8
2
8
0 123
8
2
8
0 624
8
2
8
0 847
8
2
8
0 550
8
2
8
0 432
8
2
8
1 432
8
0 373
8
2
8
0 323
8
2
8
1 323
8
0 955
8
2
8
0 947
8
2
8
0 625
8
2
8
0 ...

result:

ok 

Test #39:

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

input:

997
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
2
2
2
2
1
1
2
1
1
1
1
1
2
1
1
2
1
1
1
2
1
1
2
2
2
1
1
1
2
1
1
1
1
2
1
1
2
2
1
2
1
1
1
2
2
1
2
1
2
2
1
2
2
2
2
2
1
1
1
2
1
2
1
2
2
2
1
1
1
2
2
2
1
1
2
2
2
1
1
2
1
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
1
2
1
2
...

output:

8
0 186
8
2
8
0 627
8
2
8
0 651
8
2
8
0 160
8
2
8
0 364
8
2
8
0 888
8
2
8
0 240
8
2
8
0 381
8
2
8
0 661
8
2
8
0 313
8
2
8
0 427
8
2
8
0 832
8
2
8
1 832
8
0 554
8
2
8
0 644
8
2
8
0 99
8
2
8
0 897
8
2
8
0 617
8
2
8
0 774
8
2
8
1 774
8
0 152
8
2
8
0 8
8
2
8
0 850
8
2
8
0 483
8
2
8
0 937
8
2
8
0 980
8
2...

result:

ok 

Test #40:

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

input:

996
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
2
1
1
1
2
1
1
1
1
2
1
1
2
2
1
1
1
1
1
2
2
1
2
1
1
1
2
1
1
1
1
1
1
2
1
1
1
1
2
1
1
2
1
1
2
2
2
1
2
2
1
1
2
1
2
1
1
1
1
1
1
1
2
2
2
1
2
1
1
2
1
1
2
2
1
2
1
2
1
1
1
1
1
1
2
2
1
2
2
2
2
2
1
1
1
2
2
2
1
1
2
1
1
1
1
2
...

output:

8
0 749
8
2
8
0 609
8
2
8
0 34
8
2
8
0 844
8
2
8
0 420
8
2
8
0 878
8
2
8
0 490
8
2
8
0 366
8
2
8
0 687
8
2
8
0 215
8
2
8
0 32
8
2
8
0 72
8
2
8
0 394
8
2
8
0 964
8
2
8
0 689
8
2
8
0 265
8
2
8
0 492
8
2
8
0 8
8
2
8
0 270
8
2
8
0 906
8
2
8
0 35
8
2
8
0 628
8
2
8
1 628
8
0 955
8
2
8
0 544
8
2
8
0 673
8
...

result:

ok 

Test #41:

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

input:

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

output:

8
0 220
8
2
8
0 525
8
2
8
0 636
8
2
8
0 747
8
2
8
0 253
8
2
8
0 112
8
2
8
0 293
8
2
8
0 158
8
2
8
0 311
8
2
8
0 617
8
2
8
0 242
8
2
8
0 697
8
2
8
0 177
8
2
8
0 829
8
2
8
0 565
8
2
8
0 832
8
2
8
0 357
8
2
8
0 444
8
2
8
1 444
8
0 360
8
2
8
0 179
8
2
8
0 416
8
2
8
0 553
8
2
8
0 27
8
2
8
1 27
8
0 563
8
...

result:

ok 

Test #42:

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

input:

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

output:

8
0 746
8
2
8
0 838
8
2
8
0 946
8
2
8
0 909
8
2
8
0 853
8
2
8
0 674
8
2
8
0 75
8
2
8
0 405
8
2
8
0 700
8
2
8
0 715
8
2
8
0 109
8
2
8
0 258
8
2
8
0 817
8
2
8
0 399
8
2
8
0 852
8
2
8
0 83
8
2
8
0 860
8
2
8
0 967
8
2
8
0 874
8
2
8
0 688
8
2
8
0 267
8
2
8
0 112
8
2
8
0 614
8
2
8
0 633
8
2
8
0 355
8
2
8
...

result:

ok 

Subtask #3:

score: 32.41
Acceptable Answer

Test #43:

score: 75
Accepted
time: 1ms
memory: 3840kb

input:

2
1
2

output:

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

result:

ok 

Test #44:

score: 75
Accepted
time: 0ms
memory: 4064kb

input:

2
1
1

output:

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

result:

ok 

Test #45:

score: 75
Accepted
time: 0ms
memory: 3804kb

input:

3
1
2
1

output:

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

result:

ok 

Test #46:

score: 75
Accepted
time: 0ms
memory: 3940kb

input:

6
1
2
1
2
2
2
2
2
2

output:

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

result:

ok 

Test #47:

score: 75
Accepted
time: 1ms
memory: 3844kb

input:

10
1
1
2
2
2
2
2
2
2
2
2
1
1
2
2
2
1
2

output:

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

result:

ok 

Test #48:

score: 75
Accepted
time: 0ms
memory: 3856kb

input:

2000
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
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:

8
0 1509
8
2
8
0 733
8
2
8
1 733
8
0 772
8
2
8
1 772
8
0 1257
8
2
8
1 1257
8
0 1372
8
2
8
1 1372
8
0 679
8
2
8
1 679
8
0 732
8
2
8
1 732
8
0 81
8
2
8
1 81
8
0 1274
8
2
8
1 1274
8
0 1699
8
2
8
1 1699
8
0 525
8
2
8
1 525
8
0 843
8
2
8
1 843
8
0 1423
8
2
8
1 1423
8
0 1268
8
2
8
1 1268
8
0 129
8
2
8
1 1...

result:

ok 

Test #49:

score: 75
Accepted
time: 0ms
memory: 4168kb

input:

2000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

8
0 1214
8
2
8
0 1564
8
2
8
0 732
8
2
8
0 1715
8
2
8
0 130
8
2
8
0 1312
8
2
8
0 1789
8
2
8
0 836
8
2
8
0 554
8
2
8
0 1102
8
2
8
0 855
8
2
8
0 1593
8
2
8
0 182
8
2
8
0 1211
8
2
8
0 508
8
2
8
0 1557
8
2
8
0 469
8
2
8
0 1013
8
2
8
0 385
8
2
8
0 1570
8
2
8
0 640
8
2
8
0 1775
8
2
8
0 1986
8
2
8
0 154
8
2...

result:

ok 

Test #50:

score: 50.31
Acceptable Answer
time: 15ms
memory: 3872kb

input:

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

output:

8
0 16
8
2
8
0 1539
8
2
8
0 416
8
2
8
1 416
8
0 1570
8
2
8
0 142
8
2
8
0 1086
8
2
8
0 494
8
2
8
0 483
8
2
8
0 1210
8
2
8
0 625
8
2
8
0 655
8
2
8
0 1540
8
2
8
0 1404
8
2
8
0 1884
8
2
8
1 1884
8
0 340
8
2
8
0 690
8
2
8
1 690
8
0 670
8
2
8
1 670
8
0 1611
8
2
8
0 1092
8
2
8
0 1887
8
2
8
0 500
8
2
8
1 50...

result:

points 0.67080 points  0.67080

Test #51:

score: 50.69
Acceptable Answer
time: 11ms
memory: 3964kb

input:

2000
1
1
1
1
1
1
1
1
2
2
1
1
1
1
2
1
1
1
1
2
1
1
1
1
2
1
2
2
2
2
2
1
2
2
2
2
2
1
1
1
1
2
2
2
1
2
2
2
2
1
2
2
2
2
2
1
2
1
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
1
1
2
1
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
1
2
2
2
2
2
2
1
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2...

output:

8
0 474
8
2
8
0 1756
8
2
8
0 420
8
2
8
0 667
8
2
8
0 902
8
2
8
0 1658
8
2
8
0 1278
8
2
8
0 1738
8
2
8
0 906
8
2
8
1 906
8
0 1630
8
2
8
1 1630
8
0 118
8
2
8
0 1549
8
2
8
0 1295
8
2
8
0 1735
8
2
8
0 674
8
2
8
1 674
8
0 215
8
2
8
0 1319
8
2
8
0 1204
8
2
8
0 855
8
2
8
0 353
8
2
8
1 353
8
0 1940
8
2
8
0 ...

result:

points 0.67586666670 points  0.67586666670

Test #52:

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

input:

2000
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
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:

8
0 1387
8
2
8
0 760
8
2
8
1 760
8
0 463
8
2
8
1 463
8
0 1583
8
2
8
1 1583
8
0 1529
8
2
8
1 1529
8
0 1560
8
2
8
1 1560
8
0 1771
8
2
8
1 1771
8
0 233
8
2
8
1 233
8
0 1470
8
2
8
1 1470
8
0 641
8
2
8
1 641
8
0 1511
8
2
8
1 1511
8
0 132
8
2
8
1 132
8
0 209
8
2
8
1 209
8
0 560
8
2
8
1 560
8
0 278
8
2
8
1...

result:

ok 

Test #53:

score: 61.63
Acceptable Answer
time: 19ms
memory: 4156kb

input:

2000
1
1
2
1
2
2
2
2
2
1
1
1
2
1
1
1
1
2
2
2
1
2
1
1
1
1
1
1
1
1
1
2
1
1
2
1
1
1
1
2
1
2
1
1
2
2
1
1
1
1
2
2
2
2
2
1
2
1
1
1
2
1
1
2
1
2
2
2
2
2
1
1
1
2
1
2
1
2
2
2
1
2
1
2
1
1
2
1
2
1
2
2
1
2
2
2
2
1
2
2
2
1
1
2
1
1
2
2
2
2
2
1
1
2
1
2
1
2
2
1
2
2
2
2
2
1
2
2
2
2
1
1
2
1
1
2
2
2
2
2
2
2
2
1
1
1
1
1...

output:

8
0 1039
8
2
8
0 1795
8
2
8
0 35
8
2
8
1 35
8
0 1594
8
2
8
0 1735
8
2
8
1 1735
8
0 541
8
2
8
1 541
8
0 1502
8
2
8
1 1502
8
0 1364
8
2
8
1 1364
8
0 499
8
2
8
1 499
8
0 1400
8
2
8
0 1286
8
2
8
0 366
8
2
8
0 1801
8
2
8
1 1801
8
0 325
8
2
8
0 254
8
2
8
0 1486
8
2
8
0 1200
8
2
8
0 299
8
2
8
1 299
8
0 116...

result:

points 0.82173333330 points  0.82173333330

Test #54:

score: 74.06
Acceptable Answer
time: 3ms
memory: 3868kb

input:

2000
1
1
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
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:

8
0 1937
8
2
8
0 675
8
2
8
0 973
8
2
8
1 973
8
0 1211
8
2
8
0 292
8
2
8
1 292
8
0 1454
8
2
8
0 416
8
2
8
1 416
8
0 1724
8
2
8
1 1724
8
0 283
8
2
8
1 283
8
0 1753
8
2
8
1 1753
8
0 629
8
2
8
1 629
8
0 967
8
2
8
1 967
8
0 1942
8
2
8
1 1942
8
0 279
8
2
8
1 279
8
0 1760
8
2
8
1 1760
8
0 114
8
2
8
1 114
8...

result:

points 0.98746666670 points  0.98746666670

Test #55:

score: 50.28
Acceptable Answer
time: 19ms
memory: 3956kb

input:

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

output:

8
0 555
8
2
8
0 925
8
2
8
0 1366
8
2
8
0 71
8
2
8
0 1919
8
2
8
0 1133
8
2
8
0 722
8
2
8
0 1370
8
2
8
0 1424
8
2
8
0 1749
8
2
8
0 1497
8
2
8
0 731
8
2
8
0 1603
8
2
8
1 1603
8
0 391
8
2
8
0 541
8
2
8
0 1075
8
2
8
0 1901
8
2
8
1 1901
8
0 1238
8
2
8
0 515
8
2
8
1 515
8
0 1442
8
2
8
0 1755
8
2
8
0 1977
8...

result:

points 0.67040 points  0.67040

Test #56:

score: 73.27
Acceptable Answer
time: 4ms
memory: 4136kb

input:

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

output:

8
0 1535
8
2
8
0 582
8
2
8
1 582
8
0 1102
8
2
8
0 1917
8
2
8
1 1917
8
0 357
8
2
8
0 1000
8
2
8
0 1735
8
2
8
1 1735
8
0 1052
8
2
8
0 598
8
2
8
1 598
8
0 1939
8
2
8
1 1939
8
0 1139
8
2
8
1 1139
8
0 1864
8
2
8
1 1864
8
0 1278
8
2
8
1 1278
8
0 1962
8
2
8
1 1962
8
0 1579
8
2
8
1 1579
8
0 1583
8
2
8
1 158...

result:

points 0.97693333330 points  0.97693333330

Test #57:

score: 70.39
Acceptable Answer
time: 5ms
memory: 4008kb

input:

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

output:

8
0 1148
8
2
8
0 377
8
2
8
0 1264
8
2
8
0 1468
8
2
8
0 1062
8
2
8
1 1062
8
0 1335
8
2
8
1 1335
8
0 1285
8
2
8
1 1285
8
0 14
8
2
8
0 529
8
2
8
0 213
8
2
8
1 213
8
0 1297
8
2
8
1 1297
8
0 1533
8
2
8
1 1533
8
0 759
8
2
8
0 466
8
2
8
1 466
8
0 183
8
2
8
1 183
8
0 1973
8
2
8
1 1973
8
0 1642
8
2
8
1 1642
...

result:

points 0.93853333330 points  0.93853333330

Test #58:

score: 68.16
Acceptable Answer
time: 26ms
memory: 4148kb

input:

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

output:

8
0 1177
8
2
8
0 1795
8
2
8
1 1795
8
0 1003
8
2
8
0 1027
8
2
8
0 690
8
2
8
0 1520
8
2
8
1 1520
8
0 441
8
2
8
1 441
8
0 612
8
2
8
0 634
8
2
8
0 1723
8
2
8
1 1723
8
0 951
8
2
8
1 951
8
0 633
8
2
8
1 633
8
0 736
8
2
8
1 736
8
0 1185
8
2
8
0 438
8
2
8
1 438
8
0 1875
8
2
8
0 1051
8
2
8
1 1051
8
0 546
8
2...

result:

points 0.90880 points  0.90880

Test #59:

score: 66.41
Acceptable Answer
time: 15ms
memory: 3876kb

input:

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

output:

8
0 418
8
2
8
0 759
8
2
8
0 1492
8
2
8
0 1340
8
2
8
0 1041
8
2
8
0 1179
8
2
8
1 1179
8
0 1844
8
2
8
0 583
8
2
8
0 1101
8
2
8
1 1101
8
0 307
8
2
8
0 227
8
2
8
1 227
8
0 1352
8
2
8
0 1526
8
2
8
1 1526
8
0 998
8
2
8
1 998
8
0 37
8
2
8
0 1256
8
2
8
1 1256
8
0 834
8
2
8
0 761
8
2
8
0 522
8
2
8
1 522
8
0 ...

result:

points 0.88546666670 points  0.88546666670

Test #60:

score: 64.95
Acceptable Answer
time: 4ms
memory: 3900kb

input:

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

output:

8
0 1099
8
2
8
0 322
8
2
8
0 95
8
2
8
1 95
8
0 1726
8
2
8
0 1901
8
2
8
0 180
8
2
8
0 1121
8
2
8
1 1121
8
0 889
8
2
8
1 889
8
0 1988
8
2
8
1 1988
8
0 725
8
2
8
0 100
8
2
8
0 1441
8
2
8
0 0
8
2
8
0 11
8
2
8
0 595
8
2
8
1 595
8
0 1351
8
2
8
1 1351
8
0 1632
8
2
8
1 1632
8
0 482
8
2
8
1 482
8
0 1033
8
2
...

result:

points 0.8660 points  0.8660

Test #61:

score: 61.8
Acceptable Answer
time: 17ms
memory: 3928kb

input:

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

output:

8
0 1849
8
2
8
0 1771
8
2
8
0 56
8
2
8
0 1332
8
2
8
0 947
8
2
8
1 947
8
0 1646
8
2
8
0 1238
8
2
8
1 1238
8
0 217
8
2
8
1 217
8
0 1036
8
2
8
0 199
8
2
8
1 199
8
0 1737
8
2
8
0 1608
8
2
8
0 280
8
2
8
0 314
8
2
8
0 285
8
2
8
1 285
8
0 352
8
2
8
0 455
8
2
8
1 455
8
0 759
8
2
8
0 1605
8
2
8
1 1605
8
0 14...

result:

points 0.8240 points  0.8240

Test #62:

score: 48.49
Acceptable Answer
time: 15ms
memory: 4112kb

input:

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

output:

8
0 1632
8
2
8
0 1983
8
2
8
0 736
8
2
8
0 327
8
2
8
0 802
8
2
8
0 1916
8
2
8
0 1490
8
2
8
0 715
8
2
8
0 970
8
2
8
0 1375
8
2
8
0 1623
8
2
8
1 1623
8
0 1019
8
2
8
0 1689
8
2
8
1 1689
8
0 224
8
2
8
0 475
8
2
8
1 475
8
0 1659
8
2
8
0 1782
8
2
8
1 1782
8
0 431
8
2
8
1 431
8
0 120
8
2
8
0 1561
8
2
8
0 19...

result:

points 0.64653333330 points  0.64653333330

Test #63:

score: 40.2
Acceptable Answer
time: 20ms
memory: 3880kb

input:

2000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
2
1
2
1
1
2
1
1
1
1
2
1
2
2
1
2
2
1
1
1
1
1
1
1
1
2
2
1
1
2
2
2
1
1
1
1
1
2
1
1
2
2
1
2
2
1
1
1
1
2
1
2
1
2
2
2
2
2
1
1
1
2
2
1
2
2
2
2
2
2
1
2
1
2
1
1
2
1
2
2
2
1
2
1
1
1
2
2
2
2
1
1
1
2
2
2
1
1
2
2
1
2
1
2
2
1
2
2
2
2
1
2
2
2
1
2
2
1
2
1
2
1
2
2...

output:

8
0 1971
8
2
8
0 402
8
2
8
0 837
8
2
8
0 1603
8
2
8
0 533
8
2
8
0 1994
8
2
8
0 1693
8
2
8
0 1223
8
2
8
0 1144
8
2
8
0 911
8
2
8
0 9
8
2
8
0 736
8
2
8
0 1617
8
2
8
0 540
8
2
8
0 731
8
2
8
1 731
8
0 1431
8
2
8
0 672
8
2
8
0 946
8
2
8
0 1862
8
2
8
0 1599
8
2
8
0 500
8
2
8
0 1637
8
2
8
0 740
8
2
8
0 120...

result:

points 0.5360 points  0.5360

Test #64:

score: 35.29
Acceptable Answer
time: 19ms
memory: 4168kb

input:

1995
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
2
2
2
2
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
2
2
1
2
2
1
1
2
1
1
1
1
1
2
1
1
1
2
2
1
1
1
2
2
1
2
2
1
1
1
2
2
2
2
2
2
2
2
1
1
1
1
2
1
1
1
2
2
1
1
2
2
1
1
1
1
2
1
2
2
2
2
2
2
1
2
1
1
1
1
1
2...

output:

8
0 1947
8
2
8
0 968
8
2
8
0 1254
8
2
8
0 20
8
2
8
0 1703
8
2
8
0 1482
8
2
8
0 1941
8
2
8
0 1857
8
2
8
0 916
8
2
8
0 1626
8
2
8
0 1016
8
2
8
0 468
8
2
8
0 1370
8
2
8
0 1682
8
2
8
0 1197
8
2
8
0 558
8
2
8
0 352
8
2
8
0 24
8
2
8
0 1607
8
2
8
0 1017
8
2
8
0 865
8
2
8
1 865
8
0 869
8
2
8
0 920
8
2
8
0 1...

result:

points 0.47053333330 points  0.47053333330

Test #65:

score: 32.68
Acceptable Answer
time: 16ms
memory: 3908kb

input:

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

output:

8
0 781
8
2
8
0 473
8
2
8
0 552
8
2
8
0 528
8
2
8
0 1988
8
2
8
0 1665
8
2
8
0 900
8
2
8
0 1342
8
2
8
0 1255
8
2
8
0 1586
8
2
8
0 332
8
2
8
0 580
8
2
8
0 1447
8
2
8
0 422
8
2
8
0 61
8
2
8
0 834
8
2
8
0 1519
8
2
8
0 1357
8
2
8
0 958
8
2
8
0 1808
8
2
8
0 166
8
2
8
1 166
8
0 1
8
2
8
0 384
8
2
8
0 1242
8...

result:

points 0.43573333330 points  0.43573333330

Test #66:

score: 34.01
Acceptable Answer
time: 15ms
memory: 4168kb

input:

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

output:

8
0 1630
8
2
8
0 1748
8
2
8
0 746
8
2
8
0 911
8
2
8
0 1966
8
2
8
0 559
8
2
8
0 570
8
2
8
0 274
8
2
8
0 123
8
2
8
0 1552
8
2
8
0 1175
8
2
8
0 1927
8
2
8
0 1913
8
2
8
0 1495
8
2
8
0 999
8
2
8
0 654
8
2
8
0 942
8
2
8
0 369
8
2
8
0 1332
8
2
8
0 1882
8
2
8
0 774
8
2
8
0 208
8
2
8
0 1699
8
2
8
0 1493
8
2
...

result:

points 0.45346666670 points  0.45346666670

Test #67:

score: 32.41
Acceptable Answer
time: 14ms
memory: 4184kb

input:

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

output:

8
0 1762
8
2
8
0 877
8
2
8
0 1773
8
2
8
0 1486
8
2
8
0 704
8
2
8
0 1751
8
2
8
0 1002
8
2
8
0 388
8
2
8
0 521
8
2
8
0 159
8
2
8
0 922
8
2
8
0 882
8
2
8
0 1890
8
2
8
0 1947
8
2
8
0 423
8
2
8
0 216
8
2
8
0 1940
8
2
8
0 764
8
2
8
0 718
8
2
8
0 998
8
2
8
0 874
8
2
8
0 927
8
2
8
0 260
8
2
8
0 1560
8
2
8
0...

result:

points 0.43213333330 points  0.43213333330

Test #68:

score: 46.69
Acceptable Answer
time: 19ms
memory: 3864kb

input:

1979
1
1
1
1
1
1
1
1
1
2
1
2
1
2
2
2
1
1
1
2
1
1
1
2
1
1
2
1
1
2
1
1
2
2
2
2
1
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
1
1
2
1
1
2
1
1
2
2
2
2
1
1
2
2
2
1
1
2
2
2
2
1
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
1
1
2
2
2
2
2
1
2
2
2
2
2
1
1
2
2
2
2
2
1
2
2
2
2
2
2
2
2
1
1
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2...

output:

8
0 1561
8
2
8
0 989
8
2
8
0 1159
8
2
8
0 1470
8
2
8
0 875
8
2
8
0 269
8
2
8
0 568
8
2
8
0 318
8
2
8
0 265
8
2
8
0 1166
8
2
8
1 1166
8
0 828
8
2
8
0 1154
8
2
8
1 1154
8
0 1034
8
2
8
0 1331
8
2
8
1 1331
8
0 385
8
2
8
1 385
8
0 383
8
2
8
1 383
8
0 430
8
2
8
0 542
8
2
8
0 457
8
2
8
0 1325
8
2
8
1 1325
...

result:

points 0.62253333330 points  0.62253333330

Test #69:

score: 46.52
Acceptable Answer
time: 12ms
memory: 3960kb

input:

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

output:

8
0 1769
8
2
8
0 1198
8
2
8
0 1961
8
2
8
0 1110
8
2
8
0 201
8
2
8
0 1113
8
2
8
0 1265
8
2
8
0 1269
8
2
8
0 1724
8
2
8
0 1544
8
2
8
0 1654
8
2
8
0 700
8
2
8
1 700
8
0 1237
8
2
8
0 189
8
2
8
0 1604
8
2
8
0 1155
8
2
8
0 1449
8
2
8
0 91
8
2
8
0 692
8
2
8
0 276
8
2
8
0 1873
8
2
8
0 621
8
2
8
0 1445
8
2
8...

result:

points 0.62026666670 points  0.62026666670

Test #70:

score: 57.86
Acceptable Answer
time: 8ms
memory: 3948kb

input:

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

output:

8
0 1349
8
2
8
0 1163
8
2
8
0 360
8
2
8
0 735
8
2
8
0 1629
8
2
8
0 1740
8
2
8
0 1049
8
2
8
1 1049
8
0 1319
8
2
8
0 1586
8
2
8
0 497
8
2
8
0 1327
8
2
8
0 434
8
2
8
0 1483
8
2
8
1 1483
8
0 965
8
2
8
0 987
8
2
8
0 1099
8
2
8
0 394
8
2
8
0 252
8
2
8
1 252
8
0 1243
8
2
8
0 1390
8
2
8
0 178
8
2
8
1 178
8
...

result:

points 0.77146666670 points  0.77146666670

Test #71:

score: 57.77
Acceptable Answer
time: 7ms
memory: 4088kb

input:

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

output:

8
0 1788
8
2
8
0 805
8
2
8
0 1948
8
2
8
0 1871
8
2
8
0 719
8
2
8
0 1499
8
2
8
0 1053
8
2
8
0 870
8
2
8
0 237
8
2
8
0 472
8
2
8
0 1970
8
2
8
1 1970
8
0 1646
8
2
8
1 1646
8
0 91
8
2
8
0 452
8
2
8
0 1231
8
2
8
0 866
8
2
8
0 1168
8
2
8
1 1168
8
0 6
8
2
8
0 1305
8
2
8
1 1305
8
0 1841
8
2
8
0 852
8
2
8
0 ...

result:

points 0.77026666670 points  0.77026666670

Test #72:

score: 46.5
Acceptable Answer
time: 17ms
memory: 4024kb

input:

1981
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
2
2
2
1
2
2
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
1
2
1
1
1
2
2
1
1
2
1
2
2
1
2
1
2
1
2
1
1
2
2
2
2
2
2
2
1
1
2
2
1
1
2
2
1
2
2
2
1
1
2
2
2
2
2
2
1
2
1
2
2
1
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2...

output:

8
0 541
8
2
8
0 212
8
2
8
0 254
8
2
8
0 1879
8
2
8
0 1173
8
2
8
0 1464
8
2
8
0 514
8
2
8
0 601
8
2
8
0 382
8
2
8
0 503
8
2
8
0 1851
8
2
8
0 360
8
2
8
0 1219
8
2
8
0 1629
8
2
8
0 1846
8
2
8
0 806
8
2
8
1 806
8
0 1775
8
2
8
0 1935
8
2
8
0 903
8
2
8
1 903
8
0 691
8
2
8
1 691
8
0 1733
8
2
8
1 1733
8
0 8...

result:

points 0.620 points  0.620

Test #73:

score: 46.83
Acceptable Answer
time: 16ms
memory: 4152kb

input:

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

output:

8
0 917
8
2
8
0 1699
8
2
8
0 409
8
2
8
0 1583
8
2
8
0 1724
8
2
8
0 521
8
2
8
0 579
8
2
8
0 966
8
2
8
1 966
8
0 93
8
2
8
0 264
8
2
8
1 264
8
0 1716
8
2
8
0 894
8
2
8
1 894
8
0 1049
8
2
8
0 982
8
2
8
0 932
8
2
8
0 61
8
2
8
0 1148
8
2
8
0 749
8
2
8
0 777
8
2
8
0 1413
8
2
8
0 416
8
2
8
1 416
8
0 80
8
2
...

result:

points 0.62440 points  0.62440

Test #74:

score: 39.64
Acceptable Answer
time: 24ms
memory: 3900kb

input:

1989
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
2
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
2
1
1
2
1
1
2
2
1
1
1
1
1
1
1
1
1
2
1
1
2
2
1
1
1
1
2
2
1
1
1
1
2
1
2
1
1
2
1
2
1
1
1
2
2
1
1
1
1
1
2
1
1
2
2
1
1
1
2
2
1
1
2
2
2
1
1
1
1
1
2
1
1
2
2
2
2
2
1
2
2
2
1
2
1
1
2
2
2
2
2
2
2
1
1
1
2
2
2
1
1
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2...

output:

8
0 901
8
2
8
0 1550
8
2
8
0 1943
8
2
8
0 386
8
2
8
0 1382
8
2
8
0 245
8
2
8
0 789
8
2
8
0 1667
8
2
8
0 1711
8
2
8
1 1711
8
0 826
8
2
8
0 1709
8
2
8
0 1697
8
2
8
0 552
8
2
8
0 853
8
2
8
0 1000
8
2
8
0 507
8
2
8
1 507
8
0 756
8
2
8
0 961
8
2
8
0 261
8
2
8
0 538
8
2
8
0 1309
8
2
8
1 1309
8
0 1392
8
2
...

result:

points 0.52853333330 points  0.52853333330

Test #75:

score: 39.46
Acceptable Answer
time: 11ms
memory: 4168kb

input:

1989
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
1
2
1
1
1
1
1
2
2
1
1
2
1
1
1
1
1
1
2
1
1
1
1
1
1
2
1
1
1
1
1
1
2
1
1
1
1
2
1
2
1
1
1
1
2
1
2
2
1
2
2
1
2
2
2
2
2
2
1
1
2
2
2
2
2
1
2
1
2
1
1
1
1
1
2
2
1
1
1
2
1
1
2
1
2
2
2
1
2
2
2
2
1
1
2
2
1
2
2
1
2
1
2
2
2
2
1
1
2
1
2
2
2
2
2
2
2
2
2
2
2
2
1
1
2
1...

output:

8
0 333
8
2
8
0 1305
8
2
8
0 1206
8
2
8
0 904
8
2
8
0 454
8
2
8
0 449
8
2
8
1 449
8
0 1016
8
2
8
0 1024
8
2
8
0 1641
8
2
8
0 1710
8
2
8
0 541
8
2
8
0 619
8
2
8
0 1355
8
2
8
0 1157
8
2
8
0 1773
8
2
8
0 1616
8
2
8
0 1221
8
2
8
0 64
8
2
8
0 1520
8
2
8
0 841
8
2
8
1 841
8
0 1843
8
2
8
0 583
8
2
8
0 852
...

result:

points 0.52613333330 points  0.52613333330

Test #76:

score: 47.06
Acceptable Answer
time: 16ms
memory: 4168kb

input:

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

output:

8
0 376
8
2
8
0 1444
8
2
8
0 1637
8
2
8
0 111
8
2
8
0 835
8
2
8
0 119
8
2
8
0 441
8
2
8
0 467
8
2
8
0 1539
8
2
8
0 630
8
2
8
0 759
8
2
8
0 141
8
2
8
0 1375
8
2
8
0 457
8
2
8
0 1622
8
2
8
0 1916
8
2
8
0 731
8
2
8
0 939
8
2
8
1 939
8
0 1626
8
2
8
0 1176
8
2
8
0 1697
8
2
8
0 1488
8
2
8
0 258
8
2
8
1 25...

result:

points 0.62746666670 points  0.62746666670

Test #77:

score: 46.95
Acceptable Answer
time: 30ms
memory: 4120kb

input:

1970
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
2
1
2
1
2
1
1
2
1
2
1
1
1
1
2
2
1
2
1
2
2
2
2
2
1
1
2
2
1
1
2
2
1
2
1
1
1
1
1
2
2
2
2
2
2
1
1
2
1
1
2
2
1
2
2
1
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
1
2
2
1
2
2
2
2
1
2
2
2
2
1
2
2
2
2
1
2
2
2
1
2
2
2
1
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
1
2
2
2
2
2
2
2
2
2
2
2
2
2...

output:

8
0 1025
8
2
8
0 328
8
2
8
0 620
8
2
8
0 147
8
2
8
0 654
8
2
8
0 201
8
2
8
0 1668
8
2
8
1 1668
8
0 1842
8
2
8
0 1475
8
2
8
0 1046
8
2
8
0 57
8
2
8
0 184
8
2
8
0 1578
8
2
8
0 21
8
2
8
0 381
8
2
8
0 1682
8
2
8
1 1682
8
0 1052
8
2
8
0 1019
8
2
8
1 1019
8
0 703
8
2
8
0 1339
8
2
8
1 1339
8
0 890
8
2
8
0 ...

result:

points 0.6260 points  0.6260

Test #78:

score: 46.45
Acceptable Answer
time: 14ms
memory: 4124kb

input:

1980
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
2
1
2
1
1
1
1
2
1
1
1
1
2
2
2
2
2
2
1
1
1
2
2
1
1
2
1
2
1
1
2
2
2
1
2
2
1
1
2
1
2
1
2
1
2
1
2
2
1
2
1
1
2
2
2
2
1
2
2
2
2
2
2
1
2
1
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
1
2
1
2
2
1
2
2
2
2
2
2
1
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
1
1
2
2
2
1
2
2
2
2
2
2...

output:

8
0 812
8
2
8
0 193
8
2
8
0 1290
8
2
8
0 1835
8
2
8
0 1904
8
2
8
1 1904
8
0 718
8
2
8
0 401
8
2
8
0 1025
8
2
8
0 474
8
2
8
0 729
8
2
8
0 1488
8
2
8
0 1525
8
2
8
0 739
8
2
8
0 807
8
2
8
0 221
8
2
8
0 1349
8
2
8
1 1349
8
0 1041
8
2
8
0 238
8
2
8
1 238
8
0 1923
8
2
8
0 1795
8
2
8
0 1206
8
2
8
0 540
8
2...

result:

points 0.61933333330 points  0.61933333330

Test #79:

score: 46.36
Acceptable Answer
time: 10ms
memory: 3860kb

input:

1980
1
1
1
1
1
1
1
2
1
2
1
1
1
1
2
1
1
1
1
2
1
1
1
1
1
1
1
2
1
1
1
1
2
1
1
1
1
1
1
2
2
1
2
2
2
2
2
2
1
2
2
1
2
2
1
2
2
2
1
1
1
2
2
2
2
1
2
1
1
2
2
1
1
2
1
2
1
1
2
2
2
2
2
2
1
2
2
2
2
2
2
2
1
2
2
2
2
2
1
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2...

output:

8
0 1686
8
2
8
0 1634
8
2
8
0 819
8
2
8
0 789
8
2
8
0 1406
8
2
8
0 1008
8
2
8
0 1213
8
2
8
0 1465
8
2
8
1 1465
8
0 954
8
2
8
0 1603
8
2
8
1 1603
8
0 1262
8
2
8
0 1970
8
2
8
0 312
8
2
8
0 1561
8
2
8
0 600
8
2
8
1 600
8
0 172
8
2
8
0 881
8
2
8
0 75
8
2
8
0 1302
8
2
8
0 1084
8
2
8
1 1084
8
0 85
8
2
8
0...

result:

points 0.61813333330 points  0.61813333330

Test #80:

score: 39.17
Acceptable Answer
time: 0ms
memory: 3908kb

input:

2000
1
1
1
1
1
1
1
1
1
1
1
2
1
1
2
1
1
1
1
2
1
1
1
1
1
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
1
1
2
2
1
1
1
1
1
1
2
1
2
1
1
2
1
1
2
1
1
1
1
2
2
2
1
2
1
1
1
2
2
1
2
2
2
2
1
2
1
1
2
1
2
2
2
1
2
2
2
2
2
2
1
1
1
2
1
2
1
2
2
1
1
1
1
1
2
1
1
1
2
2
2
2
2
2
1
1
2
1
2
2
2
1
1
2
2
1
2
2
1
2
2
2
2
1
2
2
2
2
2
1
1
2
2...

output:

8
0 776
8
2
8
0 284
8
2
8
0 1287
8
2
8
0 1298
8
2
8
0 657
8
2
8
0 323
8
2
8
0 796
8
2
8
0 1762
8
2
8
0 1233
8
2
8
0 77
8
2
8
0 722
8
2
8
0 999
8
2
8
1 999
8
0 807
8
2
8
0 1303
8
2
8
0 1977
8
2
8
1 1977
8
0 266
8
2
8
0 1772
8
2
8
0 372
8
2
8
0 209
8
2
8
0 1537
8
2
8
1 1537
8
0 1434
8
2
8
0 342
8
2
8
...

result:

points 0.52226666670 points  0.52226666670

Test #81:

score: 39.02
Acceptable Answer
time: 19ms
memory: 3904kb

input:

2000
1
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
2
1
1
1
1
1
1
2
1
1
1
1
1
1
1
1
2
1
1
2
1
2
1
2
1
2
2
2
1
1
1
2
1
2
1
1
1
1
1
1
1
2
1
2
1
1
1
1
1
1
1
1
2
1
1
1
1
2
2
2
1
1
1
2
1
1
2
2
1
2
2
1
1
2
1
2
1
1
2
2
1
2
2
2
1
1
2
2
2
2
1
2
2
1
2
1
1
2
2
1
2
1
2
1
2
2
2
2
1
2
2
2
2
1
1
1
2
2
2
2
1
2
2
2
2
2
2
2
2
1
2
2...

output:

8
0 1462
8
2
8
0 532
8
2
8
0 737
8
2
8
0 192
8
2
8
0 116
8
2
8
0 1201
8
2
8
0 1725
8
2
8
0 1011
8
2
8
1 1011
8
0 812
8
2
8
0 1814
8
2
8
0 612
8
2
8
0 445
8
2
8
0 1833
8
2
8
0 437
8
2
8
0 571
8
2
8
0 837
8
2
8
0 1631
8
2
8
1 1631
8
0 416
8
2
8
0 1799
8
2
8
0 1092
8
2
8
0 1805
8
2
8
0 1291
8
2
8
0 739...

result:

points 0.52026666670 points  0.52026666670

Test #82:

score: 46.87
Acceptable Answer
time: 13ms
memory: 3936kb

input:

2000
1
1
1
1
1
1
1
1
1
1
2
1
1
2
1
1
1
2
1
1
2
2
2
1
1
1
2
1
1
1
1
1
1
1
2
1
2
1
1
1
1
1
1
1
2
2
2
1
2
2
2
2
2
2
2
1
2
2
1
1
2
2
2
2
2
1
2
1
1
1
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
1
2
1
2
2
2
2
2
1
2
2
2
1
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2...

output:

8
0 1688
8
2
8
0 1225
8
2
8
0 341
8
2
8
0 1609
8
2
8
0 436
8
2
8
0 1306
8
2
8
0 972
8
2
8
0 349
8
2
8
0 1144
8
2
8
0 1092
8
2
8
0 291
8
2
8
1 291
8
0 1534
8
2
8
0 1415
8
2
8
0 1378
8
2
8
1 1378
8
0 1805
8
2
8
0 1440
8
2
8
0 229
8
2
8
0 1091
8
2
8
1 1091
8
0 464
8
2
8
0 637
8
2
8
0 1887
8
2
8
1 1887
...

result:

points 0.62493333330 points  0.62493333330

Test #83:

score: 46.55
Acceptable Answer
time: 10ms
memory: 4124kb

input:

2000
1
1
1
1
2
1
1
1
1
1
1
1
1
2
1
1
2
1
1
1
1
2
1
1
1
1
1
1
2
1
2
2
1
1
2
1
1
1
2
1
1
1
2
2
1
2
1
1
2
2
2
2
1
2
2
2
2
2
1
2
1
1
2
2
2
2
1
2
2
2
2
1
1
1
1
2
2
2
2
2
2
1
2
2
2
2
2
2
2
1
2
2
2
2
2
2
1
2
1
2
1
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
1
1
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2...

output:

8
0 1385
8
2
8
0 1928
8
2
8
0 897
8
2
8
0 248
8
2
8
0 190
8
2
8
1 190
8
0 25
8
2
8
0 592
8
2
8
0 1334
8
2
8
0 904
8
2
8
0 1472
8
2
8
0 528
8
2
8
0 923
8
2
8
0 1571
8
2
8
0 169
8
2
8
1 169
8
0 1739
8
2
8
0 396
8
2
8
0 1919
8
2
8
1 1919
8
0 925
8
2
8
0 782
8
2
8
0 1070
8
2
8
0 189
8
2
8
0 370
8
2
8
1 ...

result:

points 0.62066666670 points  0.62066666670

Test #84:

score: 71.96
Acceptable Answer
time: 0ms
memory: 3792kb

input:

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

output:

8
0 85
8
2
8
0 228
8
2
8
1 228
8
0 367
8
2
8
0 384
8
2
8
1 384
8
0 377
8
2
8
0 512
8
2
8
1 512
8
0 268
8
2
8
1 268
8
0 220
8
2
8
1 220
8
0 294
8
2
8
1 294
8
0 120
8
2
8
1 120
8
0 438
8
2
8
1 438
8
0 163
8
2
8
1 163
8
0 273
8
2
8
1 273
8
0 348
8
2
8
1 348
8
0 455
8
2
8
1 455
8
0 222
8
2
8
1 222
8
0 3...

result:

points 0.95946666670 points  0.95946666670

Test #85:

score: 73.39
Acceptable Answer
time: 13ms
memory: 4100kb

input:

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

output:

8
0 1743
8
2
8
0 159
8
2
8
0 924
8
2
8
0 1371
8
2
8
1 1371
8
0 595
8
2
8
1 595
8
0 974
8
2
8
1 974
8
0 548
8
2
8
1 548
8
0 684
8
2
8
1 684
8
0 487
8
2
8
1 487
8
0 1429
8
2
8
1 1429
8
0 1338
8
2
8
1 1338
8
0 566
8
2
8
1 566
8
0 1383
8
2
8
1 1383
8
0 730
8
2
8
1 730
8
0 308
8
2
8
1 308
8
0 1825
8
2
8
...

result:

points 0.97853333330 points  0.97853333330

Test #86:

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

input:

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

output:

8
0 780
8
2
8
0 1293
8
2
8
1 1293
8
0 1950
8
2
8
1 1950
8
0 499
8
2
8
0 1796
8
2
8
1 1796
8
0 1906
8
2
8
1 1906
8
0 762
8
2
8
1 762
8
0 700
8
2
8
1 700
8
0 882
8
2
8
1 882
8
0 1189
8
2
8
1 1189
8
0 1025
8
2
8
1 1025
8
0 1913
8
2
8
1 1913
8
0 1654
8
2
8
1 1654
8
0 960
8
2
8
1 960
8
0 1130
8
2
8
1 113...

result:

ok 

Test #87:

score: 60.69
Acceptable Answer
time: 20ms
memory: 4204kb

input:

2000
1
1
1
2
2
2
2
2
2
1
1
1
2
1
1
2
2
1
2
2
1
1
2
1
2
2
1
2
2
2
1
2
1
2
1
2
2
1
1
1
1
1
2
1
1
1
2
1
2
1
2
2
1
1
2
1
2
1
2
2
2
2
1
2
1
1
2
1
1
1
2
1
2
1
1
2
2
1
2
1
1
1
1
2
2
2
2
2
2
1
2
1
2
2
1
1
1
2
1
1
2
2
2
1
1
1
2
2
1
2
2
1
2
2
2
1
2
2
2
2
2
2
1
2
1
1
2
1
1
2
1
1
2
2
2
1
2
1
2
1
1
1
2
1
2
2
2
2...

output:

8
0 1515
8
2
8
0 6
8
2
8
0 1641
8
2
8
0 935
8
2
8
1 935
8
0 124
8
2
8
1 124
8
0 207
8
2
8
1 207
8
0 580
8
2
8
1 580
8
0 93
8
2
8
1 93
8
0 566
8
2
8
1 566
8
0 1078
8
2
8
0 1895
8
2
8
0 1953
8
2
8
0 459
8
2
8
1 459
8
0 1664
8
2
8
0 1712
8
2
8
0 783
8
2
8
1 783
8
0 832
8
2
8
1 832
8
0 1263
8
2
8
0 60
8...

result:

points 0.80920 points  0.80920

Test #88:

score: 61.05
Acceptable Answer
time: 15ms
memory: 3932kb

input:

2000
1
1
1
1
1
1
1
2
1
1
2
1
2
1
2
2
1
1
2
1
1
1
1
1
2
2
1
1
2
1
1
1
1
2
2
2
1
2
1
1
1
2
2
1
2
1
2
2
1
2
2
2
1
2
1
1
2
2
1
2
2
1
2
2
1
2
1
1
2
2
1
1
1
2
1
2
1
2
2
2
2
1
2
2
2
1
1
2
2
2
2
2
2
2
1
1
2
2
2
2
2
2
1
2
2
2
1
2
2
1
2
2
1
2
1
1
1
2
2
1
2
2
2
1
2
2
2
1
2
2
2
2
1
2
1
2
1
1
1
1
1
1
1
2
1
1
2
1...

output:

8
0 579
8
2
8
0 580
8
2
8
0 1570
8
2
8
0 980
8
2
8
0 248
8
2
8
0 392
8
2
8
0 460
8
2
8
0 1110
8
2
8
1 1110
8
0 811
8
2
8
0 483
8
2
8
0 1360
8
2
8
1 1360
8
0 165
8
2
8
0 1096
8
2
8
1 1096
8
0 269
8
2
8
0 1588
8
2
8
1 1588
8
0 1380
8
2
8
1 1380
8
0 170
8
2
8
0 903
8
2
8
0 1210
8
2
8
1 1210
8
0 892
8
2...

result:

points 0.8140 points  0.8140

Test #89:

score: 64.47
Acceptable Answer
time: 15ms
memory: 3924kb

input:

2000
1
2
2
1
1
1
2
1
1
1
2
2
2
1
1
1
1
1
1
2
2
2
1
1
2
2
2
2
1
2
1
1
1
1
2
2
1
1
1
1
2
2
1
2
2
1
2
2
1
1
2
2
1
2
2
2
2
2
1
1
2
2
2
1
1
1
2
2
1
2
1
2
1
1
2
1
2
1
1
2
2
2
1
2
1
2
2
1
1
1
1
1
2
1
2
1
2
2
2
1
2
2
1
2
2
1
1
2
2
2
1
2
2
1
1
1
2
1
2
1
1
2
2
2
1
1
1
1
1
2
2
1
1
2
2
2
2
2
2
1
2
1
1
1
2
1
1
2...

output:

8
0 96
8
2
8
0 1663
8
2
8
1 1663
8
0 424
8
2
8
1 424
8
0 891
8
2
8
0 670
8
2
8
0 733
8
2
8
0 1742
8
2
8
1 1742
8
0 847
8
2
8
0 1250
8
2
8
0 1188
8
2
8
0 1649
8
2
8
1 1649
8
0 348
8
2
8
1 348
8
0 4
8
2
8
1 4
8
0 1415
8
2
8
0 874
8
2
8
0 903
8
2
8
0 1316
8
2
8
0 1062
8
2
8
0 1130
8
2
8
0 1603
8
2
8
1 ...

result:

points 0.85960 points  0.85960