QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#620651#2559. Endless RoadhcywoiAC ✓3651ms431628kbC++236.3kb2024-10-07 20:03:352024-10-07 20:03:36

Judging History

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

  • [2024-10-07 20:03:36]
  • 评测
  • 测评结果:AC
  • 用时:3651ms
  • 内存:431628kb
  • [2024-10-07 20:03:35]
  • 提交

answer

#include <bits/stdc++.h>

using i64 = long long;

template <typename T>
struct Fenwick {
    int n;
    std::vector<T> a;
    
    Fenwick(int n = 0) {
        init(n);
    }
    
    void init(int n) {
        this->n = n;
        a.assign(n, T());
    }
    
    void add(int x, T v) {
        for (int i = x + 1; i <= n; i += i & -i) {
            a[i - 1] += v;
        }
    }
    
    T sum(int x) {
        auto ans = T();
        for (int i = x; i > 0; i -= i & -i) {
            ans += a[i - 1];
        }
        return ans;
    }
    
    T rangesum(int l, int r) {
        return sum(r) - sum(l);
    }
    
    int kth(T k) {
        int x = 0;
        for (int i = 1 << std::__lg(n); i; i /= 2) {
            if (x + i <= n && k >= a[x + i - 1]) {
                x += i;
                k -= a[x - 1];
            }
        }
        return x;
    }
};

constexpr int N = 500010;

int cnt;
int id[N * 4], deg[N * 40];
std::vector<int> adj[N * 40];

void addEdge(int u, int v) {
    // std::cerr << u << " " << v << "\n";
    deg[v] ++ ;
    adj[u].push_back(v);
}

void build(int p, int l, int r) {
    id[p] = cnt ++ ;
    if (l == r) {
        return;
    }
    int m = (l + r) / 2;
    build(p * 2, l, m);
    build(p * 2 + 1, m + 1, r);
    addEdge(id[p * 2], id[p]);
    addEdge(id[p * 2 + 1], id[p]);
}

void add(int p, int l, int r, int x, int y, int z) {
    if (l > y || r < x) {
        return;
    }
    if (l >= x && r <= y) {
        addEdge(id[p], z);
        return;
    }

    int m = (l + r) / 2;
    add(p * 2, l, m, x, y, z);
    add(p * 2 + 1, m + 1, r, x, y, z);
}

void modify(int p, int l, int r, int x, int y) {
    if (l == r) {
        int New = cnt ++ ;
        addEdge(id[p], New);
        addEdge(y, New);
        id[p] = New;
        return;
    }

    int m = (l + r) / 2;
    if (x <= m) {
        modify(p * 2, l, m, x, y);
        int New = cnt ++ ;
        addEdge(id[p], New);
        addEdge(id[p * 2], New);
        id[p] = New;
    } else {
        modify(p * 2 + 1, m + 1, r, x, y);
        int New = cnt ++ ;
        addEdge(id[p], New);
        addEdge(id[p * 2 + 1], New);
        id[p] = New;
    }
}

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);

    int n;
    std::cin >> n;

    std::vector<int> b(n * 2);
    std::vector<std::array<int, 3>> a(n);
    for (int i = 0; i < n; i ++ ) {
        std::cin >> a[i][0] >> a[i][1];
        a[i][2] = i;
        b[i * 2] = a[i][0];
        b[i * 2 + 1] = a[i][1];
    }

    std::sort(b.begin(), b.end());
    b.erase(std::unique(b.begin(), b.end()), b.end());
    int m = b.size();
    for (int i = 0; i < n; i ++ ) {
        a[i][0] = lower_bound(b.begin(), b.end(), a[i][0]) - b.begin();
        a[i][1] = lower_bound(b.begin(), b.end(), a[i][1]) - b.begin();
    }

    std::sort(a.begin(), a.end(), 
        [&](std::array<int, 3> i, std::array<int, 3> j) {
            return i[0] != j[0] ? i[0] > j[0] : i[2] < j[2];
        });
    std::set<int> s;
    Fenwick<int> fen(m - 1);
    for (int i = 0; i < m - 1; i ++ ) {
        s.insert(i);
        fen.add(i, b[i + 1] - b[i]);
    }

    auto update = [&](int l, int r) {
        auto itl = s.lower_bound(l);
        auto itr = s.upper_bound(r);
        for (auto it = itl; it != itr; it ++ ) {
            fen.add(*it, b[*it] - b[*it + 1]);
        }
        s.erase(itl, itr);
    };

    auto query = [&](int i) {
        return fen.sum(a[i][1]) - fen.sum(a[i][0]);
    };

    // for (int i = 0; i < n; i ++ ) {
    //     std::cerr << a[i][0] << " " << a[i][1] << "\n";
    //     std::cerr << query(i) << "\n";
    // }

    cnt = n;
    build(1, 0, m - 1);
    for (int i = 0; i < n; i ++ ) {
        add(1, 0, m - 1, 0, a[i][1], i);
        modify(1, 0, m - 1, a[i][1], i);
    }

    std::queue<int> q;
    for (int i = 0; i < cnt; i ++ ) {
        if (!deg[i]) {
            q.push(i);
        }
    }

    std::vector<bool> vis(n);
    std::priority_queue<std::array<int, 3>, std::vector<std::array<int, 3>>, std::greater<>> h;
    std::set<std::pair<int, int>> seg;
    for (int i = 0; i < n; i ++ ) {
        while (!q.empty()) {
            int x = q.front();
            q.pop();
            if (x < n) {
                // std::cerr << x << "\n";
                h.push({query(x), a[x][2], x});
                seg.emplace(a[x][0], x);
            } else {
                for (auto y : adj[x]) {
                    if ( -- deg[y] == 0) {
                        q.push(y);
                    }
                }
            }
        }

        assert(!h.empty());
            while (vis[h.top()[1]]) {
                h.pop();
            }
            assert(!h.empty());
            auto [_, x, y] = h.top();
            h.pop();
            std::cout << x + 1 << " \n"[i == n - 1];
            vis[x] = true;

            update(a[y][0], a[y][1] - 1);
            seg.erase({a[y][0], y});

            // for (int i = 0; i < n; i ++ ) {
            //     std::cerr << query(i) << " \n"[i == n - 1];
            // }

            if (!seg.empty()) {
            int t = 1E9;
            auto it = seg.lower_bound({a[y][0], 0});
            while (true) {
                if (it == seg.end() || it->first >= a[y][1]) {
                    break;
                }
                int x = it->second;
                int w = query(x);
                if (t < w) {
                    break;
                }
                // std::cerr << i << " " << x << "\n";
                h.push({w, a[x][2], x});
                t = w;
                it ++ ;
            }
            t = 1E9;
            it = seg.lower_bound({a[y][0], 0});
            while (true) {
                if (it == seg.begin() || a[(--it)->second][1] <= a[y][0]) {
                    break;
                }
                int x = it->second;
                int w = query(x);
                if (t < w) {
                    break;
                }
                // std::cerr << i << " " << x << "\n";
                h.push({w, a[x][2], x});
                t = w;
            }
        }

        for (auto z : adj[y]) {
            if ( -- deg[z] == 0) {
                q.push(z);
            }
        }
    }

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 16ms
memory: 7952kb

input:

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

output:

1 2 5 3 4 6

result:

ok 6 tokens

Test #2:

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

input:

4
3 7
10 14
1 6
6 11

output:

1 3 2 4

result:

ok 4 tokens

Test #3:

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

input:

100
50 51
49 51
49 52
48 52
48 53
47 53
47 54
46 54
46 55
45 55
45 56
44 56
44 57
43 57
43 58
42 58
42 59
41 59
41 60
40 60
40 61
39 61
39 62
38 62
38 63
37 63
37 64
36 64
36 65
35 65
35 66
34 66
34 67
33 67
33 68
32 68
32 69
31 69
31 70
30 70
30 71
29 71
29 72
28 72
28 73
27 73
27 74
26 74
26 75
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 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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

result:

ok 100 tokens

Test #4:

score: 0
Accepted
time: 16ms
memory: 7756kb

input:

100
41 42
99 100
47 48
50 51
56 57
61 62
27 28
85 86
44 45
3 4
26 27
20 21
92 93
33 34
86 87
69 70
84 85
62 63
81 82
2 3
13 14
32 33
82 83
70 71
46 47
45 46
19 20
83 84
57 59
63 65
59 61
82 84
45 47
48 50
70 72
42 44
84 86
26 28
61 63
2 4
17 19
65 67
54 56
67 69
96 99
42 45
47 50
34 37
14 17
51 54
7...

output:

1 2 3 4 5 6 7 8 9 10 11 38 12 13 14 15 16 17 37 18 39 19 20 40 21 22 23 24 25 26 33 27 28 32 35 29 30 31 57 73 34 47 71 36 46 41 53 42 58 43 54 44 52 77 45 63 48 62 49 64 80 50 60 79 91 51 66 89 55 65 83 56 59 67 86 61 72 82 90 96 68 75 81 93 69 74 84 92 70 87 88 94 97 99 76 78 85 95 98 100

result:

ok 100 tokens

Test #5:

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

input:

100
26 27
68 69
33 34
96 97
42 43
6 7
60 61
22 23
9 10
19 20
38 39
7 8
73 74
64 65
53 54
84 85
15 16
79 80
62 63
11 12
32 33
80 81
95 96
54 55
83 84
89 90
55 56
74 75
97 98
81 82
23 24
57 58
14 15
34 35
59 60
40 41
46 47
18 19
21 22
56 57
35 36
69 70
82 83
94 95
63 64
86 87
31 32
76 77
39 40
47 48
4...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

result:

ok 100 tokens

Test #6:

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

input:

100
66 67
42 43
32 33
28 29
96 97
19 20
41 42
38 39
73 74
50 51
31 32
40 41
3 4
72 73
29 30
45 46
14 15
11 12
68 69
21 22
25 26
51 52
75 76
76 77
8 9
99 100
53 54
27 28
61 62
26 27
74 75
84 85
64 65
79 80
71 72
85 86
33 34
0 1
90 91
24 25
4 6
51 53
64 66
34 36
94 96
66 68
97 99
31 33
80 82
19 21
88 ...

output:

1 2 3 4 5 6 7 8 9 10 11 48 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 76 81 31 66 32 33 34 35 36 59 37 38 39 40 42 43 46 50 55 57 64 41 44 62 74 78 87 90 45 71 47 49 51 69 52 53 54 82 56 58 72 60 68 73 61 63 91 65 75 67 70 84 94 95 77 79 88 96 98 80 89 83 85 86 92 93 97 99 100

result:

ok 100 tokens

Test #7:

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

input:

100
69 70
15 16
55 56
91 92
34 35
92 93
20 21
10 11
22 23
4 5
82 83
86 87
77 78
49 50
65 66
29 30
83 84
1 2
13 14
30 31
32 33
0 1
19 20
48 49
31 33
87 89
8 10
92 94
54 56
21 23
57 59
51 53
1 3
83 85
77 79
63 65
31 34
46 49
7 10
80 83
24 27
91 94
74 77
66 69
51 54
77 80
20 23
56 59
34 37
43 46
87 90
...

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 28 42 29 30 47 33 34 35 37 46 55 26 51 59 61 68 27 39 56 63 69 71 31 48 32 45 36 38 40 65 78 49 54 62 74 77 73 76 41 64 79 43 44 58 66 50 52 67 60 72 53 57 70 75 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

result:

ok 100 tokens

Test #8:

score: 0
Accepted
time: 16ms
memory: 7792kb

input:

100
27 28
56 57
79 80
34 35
98 99
31 32
55 56
67 68
25 26
47 48
58 59
46 47
49 50
42 43
80 81
43 44
83 84
90 91
48 49
82 83
59 60
81 82
92 93
91 92
69 70
30 31
77 78
66 67
50 51
54 55
63 64
57 58
26 27
28 29
11 12
68 70
26 28
35 37
44 46
74 76
87 89
93 95
10 12
83 85
32 34
97 99
37 39
28 30
64 66
76...

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 37 34 35 36 43 44 46 48 65 50 53 58 60 62 64 66 67 68 70 71 73 77 80 84 85 87 88 89 91 38 54 39 40 61 79 41 74 78 82 42 76 83 93 45 63 75 47 49 59 69 51 55 72 81 90 86 95 92 94 96 97 98 99 52 56 57 100

result:

ok 100 tokens

Test #9:

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

input:

10000
504758807 504763364
504735683 504763364
504735683 504807338
504507299 504807338
504507299 504809080
504428573 504809080
504428573 504842988
504407969 504842988
504407969 504925719
504242659 504925719
504242659 504982796
504192499 504982796
504192499 504988790
504164090 504988790
504164090 5049...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 10000 tokens

Test #10:

score: 0
Accepted
time: 36ms
memory: 21468kb

input:

10000
970160455 970160479
932488256 932488310
383539934 383539995
375340196 375340274
865733105 865733219
735585223 735585367
687954828 687955008
870182994 870183203
320739206 320739425
905982784 905983157
628124616 628125095
558426226 558426706
562201395 562201974
439234363 439234971
709751667 7097...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 10000 tokens

Test #11:

score: 0
Accepted
time: 44ms
memory: 18524kb

input:

10000
410601820 410601821
294090792 294090799
441422212 441422222
670420210 670420222
59461862 59461893
90469319 90469353
179055474 179055527
252981238 252981294
283998869 283998965
490236705 490236809
841458496 841458612
851847119 851847283
849148457 849148637
294090609 294090792
483689813 48369000...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 10000 tokens

Test #12:

score: 0
Accepted
time: 36ms
memory: 17856kb

input:

10000
495013411 495013425
999006846 999006868
296771081 296771115
150818948 150819019
642881267 642881350
560800096 560800192
138097500 138097596
21121422 21121529
109953510 109953653
428516381 428516550
958914894 958915117
714510610 714510838
412832098 412832339
343551761 343552012
778598526 778598...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 10000 tokens

Test #13:

score: 0
Accepted
time: 43ms
memory: 18000kb

input:

10000
350318312 350318340
149202565 149202603
179261197 179261247
779925340 779925446
194445305 194445467
848400332 848400535
522118665 522118875
822005975 822006190
825371374 825371610
136200561 136200830
788364490 788364769
859844322 859844733
643922682 643923146
901332582 901333056
388316426 3883...

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 49 43 44 45 46 47 48 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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 10000 tokens

Test #14:

score: 0
Accepted
time: 30ms
memory: 20256kb

input:

10000
512474957 512474969
736102015 736102067
678460955 678461007
586742723 586742795
865924891 865924995
896796735 896796877
328184375 328184586
487430461 487430675
657033983 657034205
797801001 797801273
677420006 677420297
285432467 285432761
408167954 408168287
334723223 334723567
832094664 8320...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 10000 tokens

Test #15:

score: 0
Accepted
time: 605ms
memory: 356720kb

input:

250000
500096771 500097498
500096275 500097498
500096275 500100939
500093322 500100939
500093322 500112779
500090810 500112779
500090810 500115618
500088604 500115618
500088604 500126767
500084824 500126767
500084824 500133232
500083865 500133232
500083865 500139175
500077522 500139175
500077522 500...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #16:

score: 0
Accepted
time: 1077ms
memory: 324456kb

input:

250000
85486113 85486114
764344182 764344183
80926569 80926570
424364875 424364876
364430765 364430766
817052534 817052535
384672374 384672375
543281764 543281765
737198375 737198376
125069155 125069156
657704584 657704585
446558 446559
156161119 156161121
732837937 732837939
217487474 217487476
190...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #17:

score: 0
Accepted
time: 1331ms
memory: 370844kb

input:

250000
634183423 634183424
970923132 970923133
804072367 804072368
576349809 576349810
994154427 994154428
685654067 685654068
134115901 134115902
358374271 358374272
309901650 309901651
553753853 553753854
320313586 320313587
584364010 584364011
748086184 748086185
844313419 844313420
415503381 415...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #18:

score: 0
Accepted
time: 1162ms
memory: 347672kb

input:

250000
715346678 715346679
714637137 714637138
633551466 633551467
571236648 571236649
498709620 498709621
873709613 873709614
576384535 576384536
713177321 713177322
832495136 832495137
473929476 473929477
611535779 611535780
51152059 51152060
629294042 629294043
683330515 683330516
536475001 53647...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 152 93 94 95 96 97 98 99 100 101 ...

result:

ok 250000 tokens

Test #19:

score: 0
Accepted
time: 1106ms
memory: 344996kb

input:

250000
204357492 204357493
313754225 313754226
891470468 891470469
164687535 164687536
274352813 274352814
104592850 104592851
93157865 93157866
947093093 947093094
786274307 786274308
276719515 276719516
983251600 983251601
248092788 248092789
580394950 580394951
240692867 240692868
816006370 81600...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #20:

score: 0
Accepted
time: 806ms
memory: 346016kb

input:

250000
908254268 908254269
729940366 729940367
710542793 710542794
763639638 763639639
940321019 940321020
690381691 690381692
985556152 985556153
974524252 974524253
667359981 667359982
804102328 804102329
937363555 937363556
903556494 903556495
996482064 996482065
829397907 829397908
853180411 853...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #21:

score: 0
Accepted
time: 913ms
memory: 365304kb

input:

250000
911439698 911439699
601116606 601116607
799754310 799754311
731458404 731458405
653237434 653237435
809687265 809687266
745375860 745375861
573271297 573271298
943835593 943835594
924002421 924002422
884740893 884740894
920210232 920210233
921905222 921905223
964818240 964818241
759486093 759...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #22:

score: 0
Accepted
time: 839ms
memory: 353920kb

input:

250000
810906247 810906248
783312898 783312899
929278352 929278353
606238216 606238217
640251409 640251410
798897100 798897101
944346653 944346654
893792716 893792717
588275748 588275749
755564491 755564492
664378047 664378048
676934947 676934948
869176315 869176316
896196002 896196004
843180309 843...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #23:

score: 0
Accepted
time: 836ms
memory: 354228kb

input:

250000
966452187 966452188
911184832 911184833
736688733 736688734
637571769 637571770
883830510 883830511
652142318 652142319
654878010 654878011
920603163 920603164
912168767 912168768
887031080 887031081
731071016 731071017
985129224 985129226
625447553 625447555
938075724 938075726
640361668 640...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #24:

score: 0
Accepted
time: 1203ms
memory: 352716kb

input:

250000
575892627 575892628
923773683 923773684
623074090 623074091
746352644 746352645
851375669 851375670
412767397 412767398
215851075 215851076
450454718 450454719
958858707 958858708
244531181 244531182
676969785 676969786
994631529 994631530
545838025 545838026
685667774 685667775
590424846 590...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #25:

score: 0
Accepted
time: 1108ms
memory: 340080kb

input:

250000
421717318 421717319
272387732 272387733
957076320 957076321
753478255 753478256
400247018 400247019
438723233 438723234
126245890 126245891
817192839 817192840
899802321 899802322
641451967 641451968
77468226 77468227
899920216 899920217
341808761 341808762
495672063 495672064
451184428 45118...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #26:

score: 0
Accepted
time: 1111ms
memory: 338608kb

input:

250000
15667723 15667724
685591547 685591548
160592460 160592461
348956848 348956849
495816950 495816951
140563929 140563930
690010543 690010544
881005221 881005222
879958490 879958491
312729441 312729442
30368232 30368233
949096729 949096730
435746802 435746803
610674420 610674421
181520623 1815206...

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 104 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok 250000 tokens

Test #27:

score: 0
Accepted
time: 1232ms
memory: 360952kb

input:

250000
623592459 623592460
529342736 529342737
318696506 318696507
223988396 223988397
106543202 106543203
435530265 435530266
113563918 113563919
216000543 216000544
180787594 180787595
830824189 830824190
184038830 184038831
464818269 464818270
321644783 321644784
879731728 879731729
321698071 321...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #28:

score: 0
Accepted
time: 1177ms
memory: 359432kb

input:

250000
507202231 507202232
757693390 757693391
792197010 792197011
481005914 481005915
281579197 281579198
545997917 545997918
224943609 224943610
183451471 183451472
923239198 923239199
157569794 157569795
205581391 205581392
81071976 81071977
63496319 63496320
26726460 26726461
308333064 308333065...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #29:

score: 0
Accepted
time: 1163ms
memory: 346260kb

input:

250000
152742027 152742028
988631943 988631944
693718919 693718920
835236399 835236400
846195231 846195232
971156078 971156079
40643204 40643205
453493799 453493800
808895489 808895490
195754309 195754310
649881100 649881101
917078287 917078288
30209729 30209730
367191992 367191993
906447575 9064475...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #30:

score: 0
Accepted
time: 1018ms
memory: 351708kb

input:

250000
820083714 820083715
455532818 455532819
672408966 672408967
799624092 799624093
362239178 362239179
263818004 263818005
707415205 707415206
498890828 498890829
549055725 549055726
259244394 259244395
935654312 935654313
323901468 323901469
344512297 344512298
624028139 624028140
420977523 420...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #31:

score: 0
Accepted
time: 1036ms
memory: 353228kb

input:

250000
785310156 785310157
616756958 616756959
769557932 769557933
884589147 884589148
507437389 507437390
342202915 342202916
510430398 510430399
557387513 557387514
509675567 509675568
564141821 564141822
657181411 657181412
538793195 538793196
866363886 866363887
506491541 506491542
645459978 645...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #32:

score: 0
Accepted
time: 752ms
memory: 353304kb

input:

250000
867233463 867233464
727524519 727524520
800701962 800701963
904854946 904854947
905899680 905899681
910809299 910809300
775930190 775930191
681957425 681957426
949045891 949045892
927762699 927762700
813850695 813850697
777184307 777184309
905512374 905512376
780643953 780643955
900107965 900...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #33:

score: 0
Accepted
time: 1242ms
memory: 361936kb

input:

250000
41064860 41064861
365192452 365192453
332474706 332474707
244395718 244395719
47043554 47043555
553569909 553569910
340141934 340141935
426479029 426479030
609889800 609889801
353067496 353067497
379771073 379771074
474746166 474746167
719103945 719103946
308434035 308434036
71165138 71165139...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #34:

score: 0
Accepted
time: 1106ms
memory: 337340kb

input:

250000
101271937 101271938
703413861 703413862
432354585 432354586
315127791 315127792
253465613 253465614
937421245 937421246
46740922 46740923
567520123 567520124
344254470 344254471
521294086 521294087
598322263 598322264
9012905 9012906
239501074 239501075
398239223 398239224
515021310 515021311...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #35:

score: 0
Accepted
time: 818ms
memory: 358084kb

input:

250000
722192593 722192594
653958789 653958790
795937260 795937261
838603569 838603570
818282528 818282529
885431784 885431785
672684490 672684491
886387322 886387323
743251379 743251380
978657955 978657956
747262733 747262734
804343895 804343896
746877892 746877893
880531988 880531989
690844398 690...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #36:

score: 0
Accepted
time: 800ms
memory: 359988kb

input:

250000
840742879 840742880
796088976 796088977
974319783 974319784
807713495 807713496
649129201 649129202
763694081 763694082
794932277 794932278
664624444 664624445
806919859 806919860
798145803 798145804
905829138 905829139
875681260 875681261
643495064 643495065
923523659 923523660
901839671 901...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #37:

score: 0
Accepted
time: 824ms
memory: 357976kb

input:

250000
714244818 714244819
758924999 758925000
886453439 886453440
638331408 638331409
693854359 693854360
799892624 799892625
776491021 776491022
697581798 697581799
652461474 652461475
767212008 767212009
870797975 870797976
808413233 808413234
753533516 753533517
883741186 883741187
636166215 636...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #38:

score: 0
Accepted
time: 803ms
memory: 357556kb

input:

250000
724618109 724618110
939438135 939438136
766300581 766300582
821313665 821313666
955458914 955458915
679045549 679045550
747380342 747380343
884907781 884907782
949559834 949559835
670795625 670795626
911842147 911842148
703016029 703016030
734700048 734700049
860663783 860663784
979292013 979...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #39:

score: 0
Accepted
time: 812ms
memory: 355292kb

input:

250000
829755973 829755974
921179253 921179254
724815495 724815496
960686361 960686362
671408618 671408619
976200886 976200887
974790302 974790303
773269115 773269116
813566891 813566892
794798749 794798750
705753166 705753167
693819197 693819198
698645465 698645466
927641109 927641110
862645626 862...

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 78 79 80 81 82 83 84 85 159 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok 250000 tokens

Test #40:

score: 0
Accepted
time: 807ms
memory: 355348kb

input:

250000
915528805 915528806
942320820 942320821
921435024 921435025
698284841 698284842
750289122 750289123
681090084 681090085
765819587 765819588
728031435 728031436
748260708 748260709
676736654 676736655
974156806 974156807
845128869 845128870
922220397 922220398
711469089 711469090
741589498 741...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #41:

score: 0
Accepted
time: 814ms
memory: 360044kb

input:

250000
711045124 711045125
834068921 834068922
826787590 826787591
816460093 816460094
645767989 645767990
709857765 709857766
741358303 741358304
748677296 748677297
743269740 743269741
858077145 858077146
777118955 777118956
805541579 805541580
868137595 868137596
653491669 653491670
913963339 913...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #42:

score: 0
Accepted
time: 777ms
memory: 359976kb

input:

250000
745739052 745739053
933151515 933151516
791414723 791414724
845728531 845728532
786808592 786808593
800642037 800642038
700178474 700178475
863110603 863110604
722319993 722319994
797545919 797545920
801425253 801425254
711801969 711801970
753984158 753984159
916793343 916793344
746907731 746...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #43:

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

input:

100
98 99
79 80
83 85
67 69
29 32
86 89
81 85
57 61
64 69
91 97
81 87
36 42
30 36
42 48
38 44
57 64
42 49
8 16
68 77
3 12
61 70
16 27
57 68
20 32
15 28
78 91
81 95
42 57
57 72
74 89
23 38
8 23
45 61
34 50
22 38
41 58
9 26
77 94
34 51
75 93
57 78
50 72
28 50
54 76
2 25
53 76
59 83
57 81
19 44
60 85
1...

output:

1 2 3 4 7 11 6 5 9 8 16 23 21 29 13 26 27 38 10 40 30 19 41 47 48 50 52 54 61 64 66 68 67 44 46 42 58 59 33 53 14 17 28 36 70 84 15 62 69 80 12 34 39 72 74 78 85 87 88 43 77 81 91 79 31 94 35 71 24 76 49 56 60 51 89 95 22 25 63 65 96 75 83 73 37 98 18 32 57 86 92 55 99 90 20 45 82 93 97 100

result:

ok 100 tokens

Test #44:

score: 0
Accepted
time: 34ms
memory: 15060kb

input:

10000
627 628
344 345
36 37
633 634
280 281
914 915
440 441
666 667
206 207
889 890
236 237
127 128
753 754
460 461
867 868
563 564
679 680
37 38
143 144
144 145
936 937
504 505
731 732
508 509
904 905
44 45
705 706
859 861
157 159
687 689
358 360
138 140
594 596
42 44
197 199
380 382
433 435
297 29...

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 63 30 31 32 62 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 53 65 69 77 80 81 82 48 49 94 50 106 51 113 134 52 54 132 55 56 57 58 59 60 61 76 64 66 67 68 70 78 83 126 91 98 122 123 173 136 107 119 127 139 157 194 213 241 3...

result:

ok 10000 tokens

Test #45:

score: 0
Accepted
time: 42ms
memory: 20428kb

input:

10000
502999023 503206104
188312680 188532331
80206162 80617293
171734421 172370698
974706558 975357746
673844375 674524201
490242443 490940422
13424417 14171988
597854899 598724318
371302373 372220130
496038992 496980898
265869490 266828573
287487993 288448417
680578821 681566435
846259525 84731789...

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 31 16 17 18 19 20 21 22 23 24 25 26 27 62 28 49 29 30 37 32 33 34 35 36 38 39 46 40 52 41 42 43 44 67 45 47 48 50 51 53 95 68 54 55 56 57 96 161 58 69 59 111 164 110 197 247 160 168 317 198 285 472 327 60 87 65 61 135 63 64 86 167 209 236 185 158 294 303 357 590 2...

result:

ok 10000 tokens

Test #46:

score: 0
Accepted
time: 807ms
memory: 243476kb

input:

250000
1110 1111
7092 7093
3994 3995
3050 3051
1026 1027
5311 5312
8461 8462
2704 2705
7036 7037
5414 5415
5405 5406
3731 3732
2307 2308
930 931
2978 2979
8622 8623
2908 2909
1579 1580
7894 7895
9790 9791
1148 1149
9060 9061
2055 2056
9948 9949
7034 7035
1440 1441
9311 9312
4908 4909
9331 9332
1317 ...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 141 184 ...

result:

ok 250000 tokens

Test #47:

score: 0
Accepted
time: 1753ms
memory: 414412kb

input:

250000
606969544 606971065
168165353 168168121
186312146 186319520
613915970 613927381
555902985 555918493
544879212 544894773
134179845 134200483
383535289 383556039
718364140 718385918
189652836 189678695
744168196 744194511
909312172 909338776
620452120 620482319
203596526 203629405
998788257 998...

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 43 36 37 38 39 40 41 42 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 75 65 66 67 68 69 70 71 72 73 74 76 77 78 138 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 107 96 97 98 99 100 ...

result:

ok 250000 tokens

Test #48:

score: 0
Accepted
time: 1784ms
memory: 414376kb

input:

250000
606969544 606971065
168165353 168168121
186312146 186319520
613915970 613927381
555902985 555918493
544879212 544894773
134179845 134200483
383535289 383556039
718364140 718385918
189652836 189678695
744168196 744194511
909312172 909338776
620452120 620482319
203596526 203629405
998788257 998...

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 43 36 37 38 39 40 41 42 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 75 65 66 67 68 69 70 71 72 73 74 76 77 78 138 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 107 96 97 98 99 100 ...

result:

ok 250000 tokens

Test #49:

score: 0
Accepted
time: 1772ms
memory: 414512kb

input:

250000
606969544 606971065
168165353 168168121
186312146 186319520
613915970 613927381
555902985 555918493
544879212 544894773
134179845 134200483
383535289 383556039
718364140 718385918
189652836 189678695
744168196 744194511
909312172 909338776
620452120 620482319
203596526 203629405
998788257 998...

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 43 36 37 38 39 40 41 42 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 75 65 66 67 68 69 70 71 72 73 74 76 77 78 138 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 107 96 97 98 99 100 ...

result:

ok 250000 tokens

Test #50:

score: 0
Accepted
time: 1771ms
memory: 414356kb

input:

250000
606969544 606971065
168165353 168168121
186312146 186319520
613915970 613927381
555902985 555918493
544879212 544894773
134179845 134200483
383535289 383556039
718364140 718385918
189652836 189678695
744168196 744194511
909312172 909338776
620452120 620482319
203596526 203629405
998788257 998...

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 43 36 37 38 39 40 41 42 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 75 65 66 67 68 69 70 71 72 73 74 76 77 78 138 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 107 96 97 98 99 100 ...

result:

ok 250000 tokens

Test #51:

score: 0
Accepted
time: 1762ms
memory: 414396kb

input:

250000
606969544 606971065
168165353 168168121
186312146 186319520
613915970 613927381
555902985 555918493
544879212 544894773
134179845 134200483
383535289 383556039
718364140 718385918
189652836 189678695
744168196 744194511
909312172 909338776
620452120 620482319
203596526 203629405
998788257 998...

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 43 36 37 38 39 40 41 42 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 75 65 66 67 68 69 70 71 72 73 74 76 77 78 138 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 107 96 97 98 99 100 ...

result:

ok 250000 tokens

Test #52:

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

input:

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

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

result:

ok 100 tokens

Test #53:

score: 0
Accepted
time: 36ms
memory: 20548kb

input:

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

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 10000 tokens

Test #54:

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

input:

10000
0 100000
0 200000
0 300000
0 400000
0 500000
0 600000
0 700000
0 800000
0 900000
0 1000000
0 1100000
0 1200000
0 1300000
0 1400000
0 1500000
0 1600000
0 1700000
0 1800000
0 1900000
0 2000000
0 2100000
0 2200000
0 2300000
0 2400000
0 2500000
0 2600000
0 2700000
0 2800000
0 2900000
0 3000000
0 3...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 10000 tokens

Test #55:

score: 0
Accepted
time: 561ms
memory: 355756kb

input:

250000
0 1
0 2
0 3
0 4
0 5
0 6
0 7
0 8
0 9
0 10
0 11
0 12
0 13
0 14
0 15
0 16
0 17
0 18
0 19
0 20
0 21
0 22
0 23
0 24
0 25
0 26
0 27
0 28
0 29
0 30
0 31
0 32
0 33
0 34
0 35
0 36
0 37
0 38
0 39
0 40
0 41
0 42
0 43
0 44
0 45
0 46
0 47
0 48
0 49
0 50
0 51
0 52
0 53
0 54
0 55
0 56
0 57
0 58
0 59
0 60
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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #56:

score: 0
Accepted
time: 545ms
memory: 357692kb

input:

250000
0 4000
0 8000
0 12000
0 16000
0 20000
0 24000
0 28000
0 32000
0 36000
0 40000
0 44000
0 48000
0 52000
0 56000
0 60000
0 64000
0 68000
0 72000
0 76000
0 80000
0 84000
0 88000
0 92000
0 96000
0 100000
0 104000
0 108000
0 112000
0 116000
0 120000
0 124000
0 128000
0 132000
0 136000
0 140000
0 14...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #57:

score: 0
Accepted
time: 36ms
memory: 14884kb

input:

10000
535000000 536250000
150000000 151250000
986250000 987500000
720000000 721250000
855000000 856250000
911250000 912500000
788750000 790000000
582500000 583750000
811250000 812500000
902500000 903750000
257500000 258750000
830000000 831250000
40000000 41250000
327500000 328750000
712500000 713750...

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 42 45 48 57 34 35 36 37 38 39 40 41 43 44 46 47 49 53 50 51 52 54 55 56 63 64 65 67 72 74 82 84 91 93 99 146 155 148 159 154 157 269 58 69 59 96 60 61 62 66 68 70 71 190 139 73 77 75 76 78 79 80 81 83 86 95 90 ...

result:

ok 10000 tokens

Test #58:

score: 0
Accepted
time: 3651ms
memory: 190772kb

input:

250000
535000000 536250000
150000000 151250000
986250000 987500000
720000000 721250000
855000000 856250000
911250000 912500000
788750000 790000000
582500000 583750000
811250000 812500000
902500000 903750000
257500000 258750000
830000000 831250000
40000000 41250000
327500000 328750000
712500000 71375...

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 876 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 804 1021 1721 ...

result:

ok 250000 tokens

Test #59:

score: 0
Accepted
time: 36ms
memory: 24988kb

input:

10000
999842781 999855798
611868948 611892678
999958353 999986591
611808253 611843859
999870865 999909159
611743598 611812707
17470 141821
611504627 611666486
155194 318911
87591949 87778804
999412904 999609082
276727 473260
42614 244135
611506806 611718431
155830 393182
1246198 1484299
95263146 955...

output:

1 2 3 4 5 6 7 13 19 9 15 12 25 36 30 35 60 76 69 75 8 14 10 116 120 108 16 11 32 20 48 50 82 78 127 146 132 157 141 196 206 202 259 260 250 145 148 222 216 147 161 130 98 79 122 43 59 26 31 27 17 21 47 92 95 29 18 44 54 33 67 84 81 66 87 22 28 51 39 23 24 40 34 49 41 52 65 74 100 70 89 119 165 103 1...

result:

ok 10000 tokens

Test #60:

score: 0
Accepted
time: 942ms
memory: 431540kb

input:

250000
999998935 999999807
999929634 999934676
999970871 999976888
1430 8474
999976508 999983769
130977 139251
999914419 999923115
989820683 989829571
1764 11633
8648 18851
999979092 999989443
999915602 999925980
999894326 999905156
3715 15363
999891300 999904417
123991 137581
999959139 999973138
99...

output:

1 2 3 5 11 4 9 14 10 6 16 24 29 7 12 21 8 28 45 34 19 18 13 15 51 106 134 191 316 409 401 327 362 349 371 277 261 314 452 420 432 517 33 25 36 48 107 108 104 81 100 119 69 75 50 49 40 54 57 63 98 68 60 74 39 38 67 152 170 176 17 27 47 23 26 22 41 64 42 52 99 265 444 519 662 591 663 628 460 408 428 4...

result:

ok 250000 tokens

Test #61:

score: 0
Accepted
time: 973ms
memory: 431572kb

input:

250000
999998935 999999807
999929634 999934676
999970871 999976888
1430 8474
999976508 999983769
130977 139251
999914419 999923115
989820683 989829571
1764 11633
8648 18851
999979092 999989443
999915602 999925980
999894326 999905156
3715 15363
999891300 999904417
123991 137581
999959139 999973138
99...

output:

1 2 3 5 11 4 9 14 10 6 16 24 29 7 12 21 8 28 45 34 19 18 13 15 51 106 134 191 316 409 401 327 362 349 371 277 261 314 452 420 432 517 33 25 36 48 107 108 104 81 100 119 69 75 50 49 40 54 57 63 98 68 60 74 39 38 67 152 170 176 17 27 47 23 26 22 41 64 42 52 99 265 444 519 662 591 663 628 460 408 428 4...

result:

ok 250000 tokens

Test #62:

score: 0
Accepted
time: 959ms
memory: 431628kb

input:

250000
999998935 999999807
999929634 999934676
999970871 999976888
1430 8474
999976508 999983769
130977 139251
999914419 999923115
989820683 989829571
1764 11633
8648 18851
999979092 999989443
999915602 999925980
999894326 999905156
3715 15363
999891300 999904417
123991 137581
999959139 999973138
99...

output:

1 2 3 5 11 4 9 14 10 6 16 24 29 7 12 21 8 28 45 34 19 18 13 15 51 106 134 191 316 409 401 327 362 349 371 277 261 314 452 420 432 517 33 25 36 48 107 108 104 81 100 119 69 75 50 49 40 54 57 63 98 68 60 74 39 38 67 152 170 176 17 27 47 23 26 22 41 64 42 52 99 265 444 519 662 591 663 628 460 408 428 4...

result:

ok 250000 tokens

Test #63:

score: 0
Accepted
time: 991ms
memory: 431280kb

input:

250000
999998935 999999807
999929634 999934676
999970871 999976888
1430 8474
999976508 999983769
130977 139251
999914419 999923115
989820683 989829571
1764 11633
8648 18851
999979092 999989443
999915602 999925980
999894326 999905156
3715 15363
999891300 999904417
123991 137581
999959139 999973138
99...

output:

1 2 3 5 11 4 9 14 10 6 16 24 29 7 12 21 8 28 45 34 19 18 13 15 51 106 134 191 316 409 401 327 362 349 371 277 261 314 452 420 432 517 33 25 36 48 107 108 104 81 100 119 69 75 50 49 40 54 57 63 98 68 60 74 39 38 67 152 170 176 17 27 47 23 26 22 41 64 42 52 99 265 444 519 662 591 663 628 460 408 428 4...

result:

ok 250000 tokens

Test #64:

score: 0
Accepted
time: 993ms
memory: 431576kb

input:

250000
999998935 999999807
999929634 999934676
999970871 999976888
1430 8474
999976508 999983769
130977 139251
999914419 999923115
989820683 989829571
1764 11633
8648 18851
999979092 999989443
999915602 999925980
999894326 999905156
3715 15363
999891300 999904417
123991 137581
999959139 999973138
99...

output:

1 2 3 5 11 4 9 14 10 6 16 24 29 7 12 21 8 28 45 34 19 18 13 15 51 106 134 191 316 409 401 327 362 349 371 277 261 314 452 420 432 517 33 25 36 48 107 108 104 81 100 119 69 75 50 49 40 54 57 63 98 68 60 74 39 38 67 152 170 176 17 27 47 23 26 22 41 64 42 52 99 265 444 519 662 591 663 628 460 408 428 4...

result:

ok 250000 tokens

Test #65:

score: 0
Accepted
time: 982ms
memory: 431292kb

input:

250000
999998935 999999807
999929634 999934676
999970871 999976888
1430 8474
999976508 999983769
130977 139251
999914419 999923115
989820683 989829571
1764 11633
8648 18851
999979092 999989443
999915602 999925980
999894326 999905156
3715 15363
999891300 999904417
123991 137581
999959139 999973138
99...

output:

1 2 3 5 11 4 9 14 10 6 16 24 29 7 12 21 8 28 45 34 19 18 13 15 51 106 134 191 316 409 401 327 362 349 371 277 261 314 452 420 432 517 33 25 36 48 107 108 104 81 100 119 69 75 50 49 40 54 57 63 98 68 60 74 39 38 67 152 170 176 17 27 47 23 26 22 41 64 42 52 99 265 444 519 662 591 663 628 460 408 428 4...

result:

ok 250000 tokens

Test #66:

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

input:

100
999999999 1000000000
999999998 1000000000
999999997 1000000000
999999996 1000000000
999999995 1000000000
999999994 1000000000
999999993 1000000000
999999992 1000000000
999999991 1000000000
999999990 1000000000
999999989 1000000000
999999988 1000000000
999999987 1000000000
999999986 1000000000
99...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

result:

ok 100 tokens

Test #67:

score: 0
Accepted
time: 35ms
memory: 21812kb

input:

10000
999999999 1000000000
999999998 1000000000
999999997 1000000000
999999996 1000000000
999999995 1000000000
999999994 1000000000
999999993 1000000000
999999992 1000000000
999999991 1000000000
999999990 1000000000
999999989 1000000000
999999988 1000000000
999999987 1000000000
999999986 1000000000
...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 10000 tokens

Test #68:

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

input:

10000
999900000 1000000000
999800000 1000000000
999700000 1000000000
999600000 1000000000
999500000 1000000000
999400000 1000000000
999300000 1000000000
999200000 1000000000
999100000 1000000000
999000000 1000000000
998900000 1000000000
998800000 1000000000
998700000 1000000000
998600000 1000000000
...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 10000 tokens

Test #69:

score: 0
Accepted
time: 467ms
memory: 335696kb

input:

250000
999999999 1000000000
999999998 1000000000
999999997 1000000000
999999996 1000000000
999999995 1000000000
999999994 1000000000
999999993 1000000000
999999992 1000000000
999999991 1000000000
999999990 1000000000
999999989 1000000000
999999988 1000000000
999999987 1000000000
999999986 1000000000...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens

Test #70:

score: 0
Accepted
time: 468ms
memory: 335700kb

input:

250000
999996000 1000000000
999992000 1000000000
999988000 1000000000
999984000 1000000000
999980000 1000000000
999976000 1000000000
999972000 1000000000
999968000 1000000000
999964000 1000000000
999960000 1000000000
999956000 1000000000
999952000 1000000000
999948000 1000000000
999944000 1000000000...

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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok 250000 tokens