QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#136991#1142. Fountain Parksbashkort#55 946ms75044kbC++203.2kb2023-08-09 16:29:152024-07-04 01:26:06

Judging History

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

  • [2024-07-04 01:26:06]
  • 评测
  • 测评结果:55
  • 用时:946ms
  • 内存:75044kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-08-09 16:29:15]
  • 提交

answer

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

using namespace std;
using ll = long long;

struct DSU {
    vector<int> fa;

    void init(int n) {
        fa.resize(n);
        iota(fa.begin(), fa.end(), 0);
    }

    int find(int x) {
        return x == fa[x] ? x : fa[x] = find(fa[x]);
    }

    bool unite(int x, int y) {
        x = find(x), y = find(y);
        if (x == y) {
            return false;
        }
        fa[y] = x;
        return true;
    }
};

int construct_roads(std::vector<int> x, std::vector<int> y) {
    int n = size(x);

    if (n == 1) {
        build({}, {}, {}, {});
        return 1;
    }

    map<pair<int, int>, int> mp;
    map<pair<int, int>, vector<int>> adj;

    for (int i = 0; i < n; ++i) {
        mp[{x[i], y[i]}] = i;
    }

    DSU dsu;
    dsu.init(n);
    vector<pair<int, int>> e, f;

    for (int i = 0; i < n; ++i) {
        for (int t : {0, 1}) {
            for (int d : {-2, 2}) {
                int nx = x[i] + t * d;
                int ny = y[i] + (1 - t) * d;
                if (mp.count({nx, ny})) {
                    int j = mp[{nx, ny}];
                    if (dsu.unite(i, j)) {
                        e.emplace_back(i, j);
                    }
                }
            }
        }
    }

    if (size(e) != n - 1) {
        return false;
    }

    for (int i = 0; i < size(e); ++i) {
        int nx = x[e[i].first] + x[e[i].second] >> 1;
        int ny = y[e[i].first] + y[e[i].second] >> 1;
        if (nx % 2 == 0) {
            adj[{nx - 1, ny}].push_back(~i);
            adj[{nx + 1, ny}].push_back(i);
        } else {
            adj[{nx, ny - 1}].push_back(~i);
            adj[{nx, ny + 1}].push_back(i);
        }
    }

    vector<int> type(n - 1);
    queue<int> q;
    for (int k = 0; k < n - 1; ++k) {
        if (type[k] == 0) {
            type[k] = 1;
            q.push(k);
            while (!q.empty()) {
                int i = q.front();
                q.pop();
                int nx = x[e[i].first] + x[e[i].second] >> 1;
                int ny = y[e[i].first] + y[e[i].second] >> 1;
                if (nx % 2 == 0) {
                    nx += type[i];
                } else {
                    ny += type[i];
                }
                for (int to: adj[{nx, ny}]) {
                    int t = to >= 0 ? 1 : -1;
                    if (t == -1) {
                        to = ~to;
                    }
                    if (to == i) {
                        continue;
                    }
                    if (type[to] == 0) {
                        type[to] = -t;
                        q.push(to);
                    } else {
                        assert(type[to] != t);
                    }
                }
            }
        }
    }

    vector<int> u(n - 1), v(n - 1), a(n - 1), b(n - 1);

    for (int i = 0; i < size(e); ++i) {
        u[i] = e[i].first;
        v[i] = e[i].second;
        a[i] = x[u[i]] + x[v[i]] >> 1;
        b[i] = y[u[i]] + y[v[i]] >> 1;
        if (a[i] % 2 == 0) {
            a[i] += type[i];
        } else {
            b[i] += type[i];
        }
    }

    build(u, v, a, b);

    return 1;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 1ms
memory: 3764kb

input:

ba73dbf9c7d5e5202834d6a500541c
1
2 2

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
0

result:

ok 

Test #2:

score: 5
Accepted
time: 1ms
memory: 3768kb

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 2
2 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
1
0 1 3 3

result:

ok 

Test #3:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 2
2 6

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #4:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 2
2 4
2 6

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
2
0 1 3 3
1 2 3 5

result:

ok 

Test #5:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
2 2
2 4
2 6
2 8

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
3
0 1 3 3
1 2 3 5
2 3 3 7

result:

ok 

Test #6:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 2
2 4
2 8

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #7:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
2 2
2 4
2 8
2 10

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #8:

score: 5
Accepted
time: 1ms
memory: 3772kb

input:

ba73dbf9c7d5e5202834d6a500541c
4
2 2
2 4
2 6
2 10

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #9:

score: 5
Accepted
time: 296ms
memory: 39228kb

input:

ba73dbf9c7d5e5202834d6a500541c
100000
2 15660
2 23918
2 132200
2 117654
2 162750
2 183010
2 75554
2 29740
2 185476
2 135138
2 194024
2 182274
2 1338
2 42922
2 51616
2 171196
2 159598
2 136432
2 84454
2 61806
2 136968
2 167442
2 150036
2 23974
2 10064
2 86342
2 146274
2 174318
2 130832
2 118838
2 180...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
99999
0 30345 3 15659
0 86548 3 15661
1 55755 3 23917
1 29124 3 23919
2 13438 3 132199
2 68290 3 132201
3 13368 3 117653
3 9859 3 117655
4 23781 3 162749
4 67987 3 162751
5 79051 3 183009
5 24499 3 183011
6 12841 3 75553
6 5988 3 75555
7 8975 3 29739
7 6...

result:

ok 

Test #10:

score: 5
Accepted
time: 12ms
memory: 7228kb

input:

ba73dbf9c7d5e5202834d6a500541c
10000
2 3124
2 3126
2 3128
2 3130
2 3132
2 3134
2 3136
2 3138
2 3140
2 3142
2 3144
2 3146
2 3148
2 3150
2 3152
2 3154
2 3156
2 3158
2 3160
2 3162
2 3164
2 3166
2 3168
2 3170
2 3172
2 3174
2 3176
2 3178
2 3180
2 3182
2 3184
2 3186
2 3188
2 3190
2 3192
2 3194
2 3196
2 31...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
9999
0 1 3 3125
1 2 3 3127
2 3 3 3129
3 4 3 3131
4 5 3 3133
5 6 3 3135
6 7 3 3137
7 8 3 3139
8 9 3 3141
9 10 3 3143
10 11 3 3145
11 12 3 3147
12 13 3 3149
13 14 3 3151
14 15 3 3153
15 16 3 3155
16 17 3 3157
17 18 3 3159
18 19 3 3161
19 20 3 3163
20 21 3 ...

result:

ok 

Test #11:

score: 5
Accepted
time: 85ms
memory: 22580kb

input:

ba73dbf9c7d5e5202834d6a500541c
53891
2 3566
2 3568
2 3570
2 3572
2 3574
2 3576
2 3578
2 3580
2 3582
2 3584
2 3586
2 3588
2 3590
2 3592
2 3594
2 3596
2 3598
2 3600
2 3602
2 3604
2 3606
2 3608
2 3610
2 3612
2 3614
2 3616
2 3618
2 3620
2 3622
2 3624
2 3626
2 3628
2 3630
2 3632
2 3634
2 3636
2 3638
2 36...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
53890
0 1 3 3567
1 2 3 3569
2 3 3 3571
3 4 3 3573
4 5 3 3575
5 6 3 3577
6 7 3 3579
7 8 3 3581
8 9 3 3583
9 10 3 3585
10 11 3 3587
11 12 3 3589
12 13 3 3591
13 14 3 3593
14 15 3 3595
15 16 3 3597
16 17 3 3599
17 18 3 3601
18 19 3 3603
19 20 3 3605
20 21 3...

result:

ok 

Test #12:

score: 5
Accepted
time: 19ms
memory: 8932kb

input:

ba73dbf9c7d5e5202834d6a500541c
14979
2 4954
2 4956
2 4958
2 4960
2 4962
2 4964
2 4966
2 4968
2 4970
2 4972
2 4974
2 4976
2 4978
2 4980
2 4982
2 4984
2 4986
2 4988
2 4990
2 4992
2 4994
2 4996
2 4998
2 5000
2 5002
2 5004
2 5006
2 5008
2 5010
2 5012
2 5014
2 5016
2 5018
2 5020
2 5022
2 5024
2 5026
2 50...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
14978
0 1 3 4955
1 2 3 4957
2 3 3 4959
3 4 3 4961
4 5 3 4963
5 6 3 4965
6 7 3 4967
7 8 3 4969
8 9 3 4971
9 10 3 4973
10 11 3 4975
11 12 3 4977
12 13 3 4979
13 14 3 4981
14 15 3 4983
15 16 3 4985
16 17 3 4987
17 18 3 4989
18 19 3 4991
19 20 3 4993
20 21 3...

result:

ok 

Test #13:

score: 5
Accepted
time: 32ms
memory: 7608kb

input:

ba73dbf9c7d5e5202834d6a500541c
44171
2 36500
2 36502
2 36504
2 36506
2 36508
2 36510
2 36512
2 36514
2 36516
2 36518
2 36520
2 36522
2 36524
2 36526
2 36528
2 36530
2 36532
2 36534
2 36536
2 36538
2 36540
2 36542
2 36544
2 36546
2 36548
2 36550
2 36552
2 36554
2 36556
2 36558
2 36560
2 36562
2 36564...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #14:

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

input:

ba73dbf9c7d5e5202834d6a500541c
1000
2 20406
2 20378
2 37840
2 37702
2 20448
2 37688
2 37780
2 20720
2 38256
2 20612
2 38050
2 20152
2 37880
2 20116
2 20030
2 20526
2 38324
2 20956
2 20852
2 20356
2 37668
2 20292
2 37648
2 20320
2 20078
2 38060
2 38014
2 37738
2 37878
2 20336
2 20472
2 20214
2 38340
...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #15:

score: 5
Accepted
time: 2ms
memory: 3952kb

input:

ba73dbf9c7d5e5202834d6a500541c
2000
2 19578
2 1754
2 1760
2 130946
2 164378
2 1038
2 20302
2 131788
2 131632
2 164392
2 19868
2 164924
2 131380
2 130972
2 131348
2 1070
2 131568
2 19492
2 19876
2 131606
2 1142
2 1588
2 1424
2 1726
2 131416
2 946
2 20158
2 19574
2 20106
2 1736
2 1186
2 19476
2 164256...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #16:

score: 5
Accepted
time: 307ms
memory: 39108kb

input:

ba73dbf9c7d5e5202834d6a500541c
100000
2 103034
2 75068
2 69976
2 84860
2 113488
2 156808
2 109250
2 119184
2 169250
2 182382
2 161594
2 169232
2 41046
2 87158
2 10192
2 32612
2 84228
2 49708
2 157912
2 160028
2 160234
2 167142
2 22010
2 37360
2 64100
2 113388
2 81460
2 52862
2 77902
2 155958
2 13330...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
99999
0 22204 3 103033
0 21451 3 103035
1 41977 3 75067
1 23594 3 75069
2 89253 3 69975
2 35896 3 69977
3 83859 3 84859
3 19303 3 84861
4 99175 3 113487
4 98266 3 113489
5 98562 3 156807
5 4928 3 156809
6 45395 3 109249
6 66778 3 109251
7 95546 3 119183
...

result:

ok 

Subtask #2:

score: 10
Accepted

Dependency #1:

100%
Accepted

Test #17:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
4 4
2 4
4 2
2 2

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
3
0 2 5 3
0 1 3 5
1 3 3 3

result:

ok 

Test #18:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
4 4
2 6
2 4
4 6

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
3
0 3 5 5
0 2 3 5
1 2 1 5

result:

ok 

Test #19:

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

input:

ba73dbf9c7d5e5202834d6a500541c
6
4 6
2 4
2 2
4 2
4 4
2 6

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
5
0 4 5 5
0 5 3 7
1 2 3 3
1 5 3 5
2 3 3 1

result:

ok 

Test #20:

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

input:

ba73dbf9c7d5e5202834d6a500541c
8
4 2
2 6
4 8
2 4
4 6
2 2
4 4
2 8

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
7
0 6 5 3
0 5 3 3
1 3 3 5
1 7 1 7
1 4 3 7
2 4 5 7
3 5 1 3

result:

ok 

Test #21:

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

input:

ba73dbf9c7d5e5202834d6a500541c
8
2 10
2 4
4 4
4 8
2 2
2 8
4 10
4 2

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #22:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
2 200000
4 199998
2 199998
4 200000

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
3
0 2 3 199999
0 3 3 200001
1 3 5 199999

result:

ok 

Test #23:

score: 10
Accepted
time: 772ms
memory: 58712kb

input:

ba73dbf9c7d5e5202834d6a500541c
200000
4 177614
4 159166
2 99950
4 127824
2 158654
4 82678
2 76278
2 198694
4 142000
4 8782
2 49352
2 71260
2 194790
2 87904
2 70702
2 20966
4 161326
2 52586
2 18108
2 36098
2 160702
2 102232
2 67042
2 16712
2 141944
4 27120
4 43282
4 139388
2 144766
4 75542
4 5228
2 1...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199999
0 76079 5 177613
0 59080 5 177615
0 184307 3 177615
1 113598 5 159165
1 116266 5 159167
1 197222 3 159167
2 171355 3 99949
2 187777 1 99951
2 23587 3 99951
3 70972 5 127823
3 83598 5 127825
3 52273 3 127825
4 18005 3 158653
4 185799 1 158655
4 294...

result:

ok 

Test #24:

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

input:

ba73dbf9c7d5e5202834d6a500541c
8
2 183570
4 183570
4 183572
2 183572
2 183578
4 183574
2 183576
4 183576

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
7
0 3 3 183571
0 1 3 183569
1 2 5 183571
2 5 5 183573
4 6 3 183577
5 7 5 183575
6 7 3 183575

result:

ok 

Test #25:

score: 10
Accepted
time: 2ms
memory: 4128kb

input:

ba73dbf9c7d5e5202834d6a500541c
1173
2 186526
2 185928
4 185842
4 185780
4 185692
4 186148
4 186016
2 186236
4 185948
4 185626
2 186332
4 186206
2 186480
4 186154
2 186542
2 186504
2 186230
2 186654
2 185902
4 186762
4 186074
2 185804
4 186262
4 185834
2 186224
4 186544
4 185604
2 186300
2 186042
4 1...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
1172
0 43 3 186525
0 585 1 186527
0 729 3 186527
1 234 3 185927
1 798 1 185929
1 177 3 185929
2 517 5 185841
2 902 5 185843
2 339 3 185843
3 480 5 185779
3 563 5 185781
3 679 3 185781
4 936 5 185691
4 474 5 185693
4 214 3 185693
5 341 5 186147
5 670 5 18...

result:

ok 

Test #26:

score: 10
Accepted
time: 3ms
memory: 4064kb

input:

ba73dbf9c7d5e5202834d6a500541c
3000
2 109002
2 197108
4 198220
4 197488
4 108286
2 109006
2 197954
2 108586
4 197416
4 197132
4 197374
4 197448
4 197898
2 108330
2 197992
4 109556
2 197598
4 108114
4 109046
2 197128
2 108454
2 108892
2 108110
4 108622
4 197756
2 197924
2 109102
2 198050
2 108460
2 1...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #27:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4000
2 140462
2 140478
2 140596
2 4466
2 172072
2 140272
4 64560
2 64340
4 172244
4 64230
2 57126
4 158866
2 140482
2 64878
4 159028
4 140276
2 56814
2 4364
2 64356
4 64834
4 57096
2 3922
2 172124
4 64542
2 159218
4 140762
2 172112
4 140320
4 56964
4 158988
4 140398
2 ...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #28:

score: 10
Accepted
time: 244ms
memory: 25240kb

input:

ba73dbf9c7d5e5202834d6a500541c
80000
2 77930
2 34884
4 40062
2 34158
2 6130
4 32544
2 51290
2 50478
4 70072
4 69616
2 75800
4 5656
2 4510
2 77766
2 68358
2 42792
4 52374
4 48488
2 75616
2 46682
4 45386
4 28842
2 12918
4 8206
2 20568
2 70466
2 5562
4 61202
2 65046
4 71854
4 9510
2 45910
2 14066
4 608...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
79999
0 23775 3 77929
0 13711 1 77931
0 79027 3 77931
1 33326 3 34883
1 58477 1 34885
1 23269 3 34885
2 55865 5 40061
2 56813 5 40063
2 39583 3 40063
3 52056 3 34157
3 64583 1 34159
3 54939 3 34159
4 47236 3 6129
4 2150 1 6131
4 32735 3 6131
5 13806 5 32...

result:

ok 

Test #29:

score: 10
Accepted
time: 395ms
memory: 36536kb

input:

ba73dbf9c7d5e5202834d6a500541c
120000
2 107882
4 86012
4 127996
2 176868
2 178032
4 122930
4 178436
4 160026
4 152606
2 160512
2 84884
2 161726
4 190586
2 149048
2 131608
2 80390
2 155598
4 84696
2 182976
4 158014
4 173998
2 159392
4 128890
4 119618
4 196866
2 97962
4 188404
2 133252
4 166790
4 1593...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
119999
0 112528 3 107881
0 30090 1 107883
0 42961 3 107883
1 18968 5 86011
1 109092 5 86013
1 38897 3 86013
2 107399 5 127995
2 44395 5 127997
2 18797 3 127997
3 108142 3 176867
3 9070 1 176869
3 79857 3 176869
4 98903 3 178031
4 79372 1 178033
4 29933 3...

result:

ok 

Test #30:

score: 10
Accepted
time: 557ms
memory: 47724kb

input:

ba73dbf9c7d5e5202834d6a500541c
160000
2 52858
4 164410
2 75528
2 52886
4 109942
4 170460
2 186328
2 124554
4 197478
2 192650
4 78512
4 153868
4 155132
2 162316
4 122256
2 166830
2 163464
2 129030
4 191906
4 68290
4 64288
4 152134
4 79376
2 125460
4 51150
2 106656
4 139088
2 136352
2 52620
4 95892
2 ...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
159999
0 137867 3 52857
0 30042 1 52859
0 146571 3 52859
1 52543 5 164409
1 103782 5 164411
1 89480 3 164411
2 115638 3 75527
2 65071 1 75529
2 16443 3 75529
3 61317 3 52885
3 67481 1 52887
3 53826 3 52887
4 5792 5 109941
4 64092 5 109943
4 110069 3 1099...

result:

ok 

Test #31:

score: 10
Accepted
time: 790ms
memory: 58644kb

input:

ba73dbf9c7d5e5202834d6a500541c
200000
4 159176
4 173814
4 148140
4 192932
2 10458
4 82176
2 192792
4 58608
4 152072
2 179396
4 65044
2 43890
2 6200
4 72634
2 27580
2 178602
2 61556
4 157146
2 133400
4 126376
4 18694
2 195536
4 159494
4 84034
2 33830
4 92734
2 6522
4 109768
2 101402
4 6176
4 53030
2 ...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199999
0 51331 5 159175
0 40413 5 159177
0 12274 3 159177
1 43270 5 173813
1 88810 5 173815
1 105191 3 173815
2 133860 5 148139
2 18164 5 148141
2 91344 3 148141
3 27438 5 192931
3 62279 5 192933
3 191674 3 192933
4 103854 3 10457
4 132056 1 10459
4 1055...

result:

ok 

Test #32:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
4 2
4 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
1
0 1 5 3

result:

ok 

Test #33:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 2
4 2

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
1
0 1 3 3

result:

ok 

Test #34:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 4
4 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
1
0 1 3 5

result:

ok 

Test #35:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 2
4 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #36:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 4
4 2

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #37:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 2
2 4
4 2

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
2
0 1 3 3
0 2 3 1

result:

ok 

Test #38:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 2
2 4
4 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
2
0 1 3 3
1 2 3 5

result:

ok 

Test #39:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 2
4 2
4 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
2
0 1 3 3
1 2 5 3

result:

ok 

Test #40:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 4
4 2
4 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
2
0 2 3 5
1 2 5 3

result:

ok 

Test #41:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 4
4 2
4 6

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #42:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 200000
2 199998
4 200000

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
2
0 1 3 199999
0 2 3 200001

result:

ok 

Test #43:

score: 10
Accepted
time: 2ms
memory: 3924kb

input:

ba73dbf9c7d5e5202834d6a500541c
2000
2 66072
2 15600
2 65278
2 65372
2 15154
2 64698
4 15472
4 15336
4 15714
4 65714
2 65516
4 65552
2 64890
2 15174
2 65674
2 14732
2 15150
4 65768
2 15672
2 14610
4 15530
2 65776
2 15370
4 65724
2 15308
2 15412
4 15712
4 14620
4 14600
2 15404
4 15918
2 14858
2 15488
...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #44:

score: 10
Accepted
time: 3ms
memory: 4316kb

input:

ba73dbf9c7d5e5202834d6a500541c
3000
2 111548
2 111040
4 70070
2 177612
2 110868
2 111368
4 17940
2 111432
2 59736
2 177494
4 110958
2 70064
2 59920
2 70092
4 177672
2 59336
4 69988
4 111040
2 59840
4 18638
4 18042
2 111192
2 177526
4 69992
4 177776
4 69676
4 177824
4 111128
4 111278
4 59162
2 111592...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #45:

score: 10
Accepted
time: 302ms
memory: 32172kb

input:

ba73dbf9c7d5e5202834d6a500541c
100000
4 169676
2 166424
4 184362
4 189372
4 92358
4 163106
4 106516
4 84160
2 80238
2 189392
4 195840
2 118396
4 94344
4 188728
2 189284
2 164532
2 140524
2 126720
4 182624
4 131538
2 172512
2 163134
2 123156
4 137156
4 168310
2 140776
4 181764
2 92658
2 124148
4 1125...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
99999
0 57741 5 169675
0 31285 5 169677
1 94014 3 166423
1 41190 3 166425
2 28665 5 184361
2 91610 5 184363
3 81923 5 189373
3 42770 3 189373
4 31569 5 92357
4 98269 5 92359
5 65441 3 163107
6 44858 3 106517
7 17969 5 84159
7 53483 3 84161
8 32131 3 8023...

result:

ok 

Test #46:

score: 10
Accepted
time: 509ms
memory: 45556kb

input:

ba73dbf9c7d5e5202834d6a500541c
145093
2 166114
2 57160
2 100318
2 183710
2 157582
4 87300
2 108292
4 26942
4 152146
4 67878
2 189520
2 105504
4 182488
4 20028
4 149088
2 27528
4 54250
2 100720
2 62956
4 60756
2 107208
4 156884
2 184558
2 79524
4 152584
4 101220
2 8320
4 149952
4 2512
4 63280
2 14975...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
145092
0 134467 3 166115
0 17095 3 166113
1 47951 3 57159
1 136889 3 57161
2 104958 3 100319
2 69146 3 100317
3 72445 3 183709
3 19985 3 183711
4 65318 3 157583
5 125525 5 87299
5 45891 5 87301
6 73031 3 108291
6 131027 1 108293
6 3953 3 108293
7 7694 5 ...

result:

ok 

Test #47:

score: 10
Accepted
time: 520ms
memory: 45364kb

input:

ba73dbf9c7d5e5202834d6a500541c
145075
2 155250
2 136442
2 94908
2 158406
4 57086
2 97650
4 48200
2 12782
2 185128
2 197282
4 27270
2 122262
4 66214
2 31156
2 150590
2 12294
4 1562
4 94584
2 23458
4 157278
4 33026
2 191138
4 147538
2 8652
2 108482
4 67498
4 157020
2 13190
2 30028
4 77576
4 44258
4 16...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
145074
0 64143 3 155251
0 63781 3 155249
1 115124 3 136441
1 130354 1 136443
1 40870 3 136443
2 75949 3 94907
2 100366 3 94909
3 7770 3 158407
3 98185 3 158405
4 109672 5 57085
4 62695 3 57087
5 18126 3 97651
6 25692 5 48199
6 31510 5 48201
6 122894 3 48...

result:

ok 

Subtask #3:

score: 0
Runtime Error

Dependency #2:

100%
Accepted

Test #48:

score: 15
Accepted
time: 1ms
memory: 3720kb

input:

ba73dbf9c7d5e5202834d6a500541c
4
6 2
4 2
6 4
4 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
3
0 2 7 3
0 1 5 3
1 3 3 3

result:

ok 

Test #49:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
6 6
4 4
6 4
4 6

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
3
0 2 7 5
0 3 5 7
1 3 5 5

result:

ok 

Test #50:

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

input:

ba73dbf9c7d5e5202834d6a500541c
6
6 2
2 2
6 4
2 4
4 2
4 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
5
0 2 7 3
0 4 5 3
1 3 3 3
1 4 3 1
2 5 5 5

result:

ok 

Test #51:

score: 15
Accepted
time: 1ms
memory: 3936kb

input:

ba73dbf9c7d5e5202834d6a500541c
7
6 4
4 4
2 2
4 6
4 2
2 4
6 6

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
6
0 6 7 5
0 1 5 5
1 4 5 3
1 3 3 5
1 5 3 3
2 5 1 3

result:

ok 

Test #52:

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

input:

ba73dbf9c7d5e5202834d6a500541c
8
4 2
2 2
6 8
4 6
4 8
4 4
6 6
2 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
7
0 5 5 3
0 1 3 3
1 7 1 3
2 6 7 7
2 4 5 9
3 5 5 5
3 4 5 7

result:

ok 

Test #53:

score: 0
Runtime Error

input:

ba73dbf9c7d5e5202834d6a500541c
7
2 4
4 4
6 2
4 2
2 6
4 6
6 4

output:

Unauthorized output

result:


Subtask #4:

score: 20
Accepted

Test #82:

score: 20
Accepted
time: 0ms
memory: 3720kb

input:

ba73dbf9c7d5e5202834d6a500541c
3
200000 2
200000 4
199998 2

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
2
0 1 200001 3
0 2 199999 3

result:

ok 

Test #83:

score: 20
Accepted
time: 0ms
memory: 4020kb

input:

ba73dbf9c7d5e5202834d6a500541c
3
200000 200000
200000 199998
199998 200000

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
2
0 1 200001 199999
0 2 199999 200001

result:

ok 

Test #84:

score: 20
Accepted
time: 0ms
memory: 3768kb

input:

ba73dbf9c7d5e5202834d6a500541c
12
2 2
2 4
4 2
2 200000
2 199998
4 200000
200000 2
200000 4
199998 2
200000 200000
200000 199998
199998 200000

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #85:

score: 20
Accepted
time: 704ms
memory: 53028kb

input:

ba73dbf9c7d5e5202834d6a500541c
199999
195232 4772
192370 7632
64282 135722
174444 25558
54846 145156
70170 129832
196228 3774
23234 176768
186862 13140
22458 177546
18158 181846
144902 55100
109692 90310
154220 45782
180406 19598
176744 23260
69098 130906
83308 116694
728 199274
143272 56730
17012 1...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199998
0 114192 195233 4771
0 183397 195231 4773
1 172969 192369 7633
1 137403 192371 7633
2 183528 64281 135721
2 127552 64281 135723
3 136306 174443 25559
3 110702 174445 25559
4 81542 54845 145157
4 24147 54847 145157
5 175852 70169 129833
5 14273 701...

result:

ok 

Test #86:

score: 20
Accepted
time: 718ms
memory: 53112kb

input:

ba73dbf9c7d5e5202834d6a500541c
199997
56858 56864
1456 1462
51406 51410
89266 89272
53562 53556
80164 80158
13970 13966
41960 41966
48338 48342
98766 98772
82904 82898
38168 38172
28780 28774
38142 38146
16616 16612
15258 15262
69676 69672
85410 85416
59306 59310
712 718
6144 6140
61280 61286
28928 ...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199996
0 178618 56859 56863
0 69117 56859 56865
1 164263 1457 1461
1 94816 1457 1463
2 10313 51407 51411
2 47909 51405 51411
3 181819 89267 89271
3 138138 89267 89273
4 195085 53563 53557
4 176501 53561 53557
5 117046 80165 80159
5 90488 80163 80159
6 12...

result:

ok 

Test #87:

score: 20
Accepted
time: 715ms
memory: 53064kb

input:

ba73dbf9c7d5e5202834d6a500541c
199997
65538 34474
61104 38910
57364 42638
29768 70236
50488 49524
91868 8146
42764 57238
16096 83906
17718 82294
91644 8368
90818 9186
83908 16096
97246 2756
68350 31652
53514 46498
10854 89158
64174 35838
62258 37746
36734 63280
76516 23496
19968 80036
2764 97240
559...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199996
0 31471 65539 34475
0 4262 65539 34473
1 75395 61105 38909
1 135770 61103 38911
2 97792 57365 42639
2 12192 57365 42637
3 186447 29769 70235
3 154870 29767 70237
4 36676 50487 49525
4 163528 50489 49525
5 191484 91869 8145
5 122132 91867 8145
6 19...

result:

ok 

Test #88:

score: 20
Accepted
time: 648ms
memory: 64296kb

input:

ba73dbf9c7d5e5202834d6a500541c
169995
97050 40000
83488 40000
83726 40000
100000 25052
100000 13668
2 904
60986 40000
28594 20000
51184 40000
40000 12506
92936 2
32440 40000
61562 2
29342 2
29178 2
31564 2
84020 2
22850 2
86310 40000
2 25682
67964 20000
27174 2
34700 40000
100000 18902
24042 20000
8...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
169994
0 149070 97049 40001
0 48803 97051 40001
1 49792 83487 40001
1 91806 83489 40001
2 38800 83725 40001
2 107485 83727 40001
3 76844 100001 25051
3 23935 100001 25053
4 128104 100001 13667
4 127847 100001 13669
5 140016 3 903
5 28879 3 905
6 105649 6...

result:

ok 

Test #89:

score: 20
Accepted
time: 354ms
memory: 19520kb

input:

ba73dbf9c7d5e5202834d6a500541c
200000
1314 1854
274 822
298 698
1510 1034
958 1170
938 878
558 406
1442 1542
1394 734
546 1234
1018 1426
1206 1454
414 402
210 566
1578 426
230 278
1022 1102
462 1026
166 66
1374 1810
1334 202
314 1042
602 1658
1598 550
718 1650
186 1618
1062 1806
262 1614
1082 1950
9...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #90:

score: 20
Accepted
time: 442ms
memory: 21712kb

input:

ba73dbf9c7d5e5202834d6a500541c
200000
194 138
778 1194
636 506
688 34
322 418
332 1882
706 574
106 746
162 1682
16 650
90 830
794 926
266 1642
468 914
790 438
354 1242
200 1530
706 402
482 822
612 1926
292 1934
224 662
172 1362
676 1294
344 1602
290 466
734 1238
300 1938
224 30
184 1370
520 822
264 ...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #91:

score: 20
Accepted
time: 357ms
memory: 21700kb

input:

ba73dbf9c7d5e5202834d6a500541c
200000
166 984
734 960
1026 70
1018 572
774 48
758 496
486 720
1090 680
862 120
1510 284
790 824
58 878
1102 690
910 256
322 140
6 750
630 554
86 506
122 898
1498 886
1266 110
470 514
114 832
338 182
1094 300
718 288
278 532
470 42
630 614
438 96
958 252
378 764
958 11...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #92:

score: 20
Accepted
time: 765ms
memory: 75004kb

input:

ba73dbf9c7d5e5202834d6a500541c
199999
1398 812
1458 624
1286 630
1430 638
1250 584
1026 92
1026 148
1114 750
38 642
1202 748
842 38
998 638
662 594
1570 430
710 258
26 552
154 442
10 666
922 378
90 488
1490 538
1594 662
1154 502
210 416
670 672
454 256
898 774
590 148
1318 842
1266 794
746 860
310 9...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199998
0 141453 1399 811
0 95131 1399 813
1 173051 1459 623
1 33099 1459 625
2 138067 1287 629
2 185399 1287 631
3 177627 1431 637
3 32622 1431 639
4 185453 1251 583
4 93378 1251 585
5 111374 1027 91
5 35313 1027 93
6 135827 1027 147
6 165035 1027 149
7 ...

result:

ok 

Test #93:

score: 20
Accepted
time: 780ms
memory: 75024kb

input:

ba73dbf9c7d5e5202834d6a500541c
199999
866 434
1150 510
298 342
1442 170
382 976
686 442
854 894
318 976
166 640
1562 246
1438 814
1382 872
1558 782
578 320
1378 474
1474 320
1590 628
1554 278
682 82
554 318
34 248
674 870
246 522
726 482
1390 920
1298 682
294 622
402 472
1198 742
614 264
598 630
910...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199998
0 116856 867 433
0 139943 867 435
1 195765 1151 509
1 190724 1151 511
2 8284 299 341
2 141027 299 343
3 197560 1443 169
3 12567 1443 171
4 169426 383 975
4 182652 383 977
5 19779 687 441
5 191687 687 443
6 100077 855 893
6 117484 855 895
7 149502 ...

result:

ok 

Test #94:

score: 20
Accepted
time: 825ms
memory: 75036kb

input:

ba73dbf9c7d5e5202834d6a500541c
199999
972 594
440 1198
762 586
426 1542
468 126
252 1434
182 1442
452 814
778 386
744 1118
854 82
912 178
84 1366
982 1202
212 1106
226 1442
210 878
570 890
422 846
264 1334
772 910
66 926
118 1094
304 98
810 1426
34 158
142 2
258 698
732 554
152 1110
290 490
794 690
...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199998
0 30935 971 595
0 19228 973 595
1 26137 439 1199
1 99162 441 1199
2 55334 761 587
2 50834 763 587
3 70555 425 1543
3 69154 427 1543
4 78949 467 127
4 110193 469 127
5 56006 251 1435
5 86455 253 1435
6 35105 181 1443
6 40239 183 1443
7 2320 451 815...

result:

ok 

Test #95:

score: 20
Accepted
time: 796ms
memory: 75036kb

input:

ba73dbf9c7d5e5202834d6a500541c
199999
628 130
416 710
642 1042
500 138
150 202
294 166
742 1166
872 1094
854 378
500 846
72 490
122 10
328 422
54 834
340 1426
264 818
466 774
254 422
338 1554
952 542
238 1502
42 322
672 474
826 1246
994 1454
614 1418
816 386
314 346
620 1526
982 1298
296 1490
310 67...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199998
0 89742 627 131
0 54663 629 131
1 79585 415 711
1 122356 417 711
2 2195 641 1043
2 182975 643 1043
3 146785 499 139
3 6362 501 139
4 10250 149 203
4 71412 151 203
5 107769 293 167
5 89919 295 167
6 115392 741 1167
6 38065 743 1167
7 11483 871 1095...

result:

ok 

Test #96:

score: 20
Accepted
time: 1ms
memory: 3772kb

input:

ba73dbf9c7d5e5202834d6a500541c
7
183572 142078
183572 142080
183568 142076
183574 142078
183574 142076
183568 142078
183570 142078

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
6
0 1 183573 142079
0 6 183571 142079
0 3 183573 142077
2 5 183569 142077
3 4 183575 142077
5 6 183569 142079

result:

ok 

Test #97:

score: 20
Accepted
time: 21ms
memory: 7112kb

input:

ba73dbf9c7d5e5202834d6a500541c
14125
185792 20626
186256 20742
186128 20844
186294 20356
185902 20752
186302 20350
185884 20314
185894 20614
185980 20576
186148 20520
185830 20870
185858 20382
186108 20826
186204 20714
185822 20694
185928 20984
185768 20438
186176 20758
185926 20604
186106 20672
185...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
14124
0 8570 185791 20627
0 8271 185793 20627
1 2012 186255 20743
1 4845 186257 20743
2 11721 186127 20845
2 11069 186129 20845
3 1052 186295 20357
3 4513 186295 20355
4 9250 185903 20751
4 2451 185901 20753
5 13517 186303 20351
5 4729 186301 20351
5 135...

result:

ok 

Test #98:

score: 20
Accepted
time: 97ms
memory: 11444kb

input:

ba73dbf9c7d5e5202834d6a500541c
100000
177456 177456
171074 171074
168200 168200
161352 161352
67104 67104
118318 118318
52258 52258
922 922
48450 48450
198048 198048
78358 78358
25852 25852
190812 190812
55744 55744
100624 100624
67562 67562
100866 100866
151566 151566
150458 150458
89932 89932
1124...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #99:

score: 20
Accepted
time: 623ms
memory: 53100kb

input:

ba73dbf9c7d5e5202834d6a500541c
199999
36996 36996
186060 186060
138654 138654
119648 119648
77274 77274
155998 155998
126848 126846
40008 40008
131372 131372
176154 176154
52550 52550
28622 28620
152276 152274
163746 163744
77792 77790
26394 26392
107542 107542
137218 137218
99318 99318
123124 12312...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199998
0 72651 36997 36995
0 140297 36997 36997
1 68639 186061 186059
1 73338 186061 186061
2 152379 138655 138653
2 167017 138655 138655
3 19259 119649 119647
3 18413 119649 119649
4 15516 77275 77273
4 137259 77275 77275
5 61025 155999 155997
5 1864 15...

result:

ok 

Test #100:

score: 20
Accepted
time: 11ms
memory: 4660kb

input:

ba73dbf9c7d5e5202834d6a500541c
10000
176796 4336
103510 178630
176666 4270
176706 4416
176736 4434
176678 4446
176682 4352
176682 4328
103620 178604
176774 4284
176762 4278
176664 4418
103654 178692
176752 4376
176800 4358
176700 4426
103638 178626
176668 4434
103624 178694
103638 178756
103504 1786...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #101:

score: 20
Accepted
time: 63ms
memory: 7900kb

input:

ba73dbf9c7d5e5202834d6a500541c
50000
19712 125246
21028 78432
107586 175540
41632 93316
40222 19636
107864 175496
41542 93234
19724 125336
21004 78390
19840 125472
107696 175608
107744 175604
107868 175560
20950 78474
40432 19666
41542 93254
19828 125410
19672 125296
41694 93142
41650 93228
20986 78...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #102:

score: 20
Accepted
time: 167ms
memory: 12572kb

input:

ba73dbf9c7d5e5202834d6a500541c
100000
11532 82706
12484 8300
116672 115008
12586 8316
116574 115040
91278 196254
167350 193456
91178 196396
167250 193500
11696 82884
12456 8192
167330 193490
167264 193368
162872 76530
162838 76386
11692 82780
21684 51392
116554 115012
167308 193302
167246 193300
175...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #103:

score: 20
Accepted
time: 218ms
memory: 24820kb

input:

ba73dbf9c7d5e5202834d6a500541c
80000
110632 196678
110706 196562
110062 196474
110372 197130
110334 196998
110584 196940
110462 196562
110576 196678
110076 196620
110630 196486
110586 196562
110194 197046
110232 196526
110576 196778
110488 197020
110092 196852
110704 196558
110254 196698
110692 1966...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
79999
0 45227 110631 196679
0 73852 110633 196679
1 5579 110707 196561
1 45001 110707 196563
2 61716 110061 196475
2 72219 110063 196475
3 73070 110373 197131
3 42497 110371 197131
3 65550 110373 197129
4 2538 110335 196997
4 78377 110335 196999
5 68771 ...

result:

ok 

Test #104:

score: 20
Accepted
time: 331ms
memory: 33180kb

input:

ba73dbf9c7d5e5202834d6a500541c
110000
153248 86150
153422 86140
153336 85974
153374 85680
153026 85962
153322 85930
153536 85810
152996 86246
153750 85712
153536 86158
153790 86094
153098 85904
153182 85690
153078 86148
153848 86062
153656 85888
153066 85882
153096 85824
153554 85590
153518 86200
15...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
109999
0 58369 153249 86149
0 31128 153249 86151
0 464 153247 86151
1 47814 153421 86141
1 71849 153423 86141
2 76461 153337 85975
2 71758 153335 85975
2 4224 153337 85973
3 14569 153375 85681
4 109712 153027 85961
4 83687 153025 85963
4 50001 153027 859...

result:

ok 

Test #105:

score: 20
Accepted
time: 488ms
memory: 40932kb

input:

ba73dbf9c7d5e5202834d6a500541c
140000
182484 19098
182932 18626
183100 19106
183132 19482
182768 18952
183204 19426
182944 18630
183078 19558
182858 18640
183242 19530
183212 19092
183248 18828
183174 19230
183330 18848
183322 18710
182638 18824
183070 18818
182708 18952
183010 19154
183120 19540
18...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
139999
0 13150 182483 19099
0 127229 182485 19099
1 32271 182933 18627
1 102899 182933 18625
2 46540 183099 19107
2 67421 183101 19107
3 105231 183133 19483
3 59095 183131 19483
4 70591 182769 18951
4 111022 182767 18953
4 100508 182769 18953
5 77238 183...

result:

ok 

Test #106:

score: 20
Accepted
time: 625ms
memory: 49396kb

input:

ba73dbf9c7d5e5202834d6a500541c
170000
12466 152266
12366 152380
12874 152026
12384 151764
12674 151762
12364 151662
12394 152198
13164 152022
12042 152002
12498 152164
12416 152346
12554 152040
12246 151920
12190 151820
12110 152452
12858 152564
12834 152132
13022 152014
12706 152692
12468 151568
12...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
169999
0 138244 12467 152265
0 38497 12465 152267
1 59298 12365 152381
2 88369 12875 152025
3 51246 12385 151763
3 14820 12385 151765
3 101367 12383 151765
4 154029 12675 151763
5 93885 12365 151661
5 141715 12363 151663
5 89491 12363 151661
5 39948 1236...

result:

ok 

Test #107:

score: 20
Accepted
time: 731ms
memory: 57264kb

input:

ba73dbf9c7d5e5202834d6a500541c
200000
121744 79484
121292 78880
120816 79608
121418 79068
121408 79102
121396 79782
121148 79636
121194 79636
121052 79024
120820 79454
121652 79184
121112 80116
121204 79382
121096 79926
121154 80104
121514 79848
121274 80028
121786 79584
120990 79962
121284 79608
12...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199999
0 134416 121745 79483
0 144130 121743 79485
0 58441 121745 79485
1 38015 121293 78879
2 103768 120817 79609
3 121490 121417 79069
3 107175 121419 79069
4 149442 121409 79101
4 126324 121407 79103
5 133820 121397 79783
6 79047 121149 79637
7 52257 ...

result:

ok 

Subtask #5:

score: 20
Accepted

Test #108:

score: 20
Accepted
time: 699ms
memory: 75044kb

input:

ba73dbf9c7d5e5202834d6a500541c
200000
82422 100002
100002 52498
82816 2
97624 2
100002 58032
20638 100002
100002 7646
80512 2
2 10584
28426 100002
2 83036
2 64556
47872 100002
55196 2
85350 100002
2 95376
2 23942
12488 100002
83178 2
2 9086
85598 2
100002 78820
100002 10868
98810 2
84182 100002
2 71...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199999
0 148989 82421 100003
0 168975 82423 100003
1 67645 100003 52497
1 117727 100003 52499
2 150926 82815 3
2 142334 82817 3
3 164963 97623 3
3 141442 97625 3
4 9204 100003 58031
4 66537 100003 58033
5 106842 20637 100003
5 10116 20639 100003
6 182160...

result:

ok 

Test #109:

score: 20
Accepted
time: 677ms
memory: 75028kb

input:

ba73dbf9c7d5e5202834d6a500541c
199999
10674 50002
7228 2
31566 50002
48790 2
87212 50002
100002 76172
54282 100002
2 33136
100002 78564
50002 9882
50848 50002
50002 83692
92422 100002
100002 78880
100002 71432
50002 65586
3750 2
50002 11898
50002 17296
50002 44774
3836 2
49936 50002
50002 48536
1542...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199998
0 28598 10673 50003
0 113011 10675 50003
1 28885 7227 3
1 161862 7229 3
2 195414 31565 50003
2 171672 31567 50003
3 41810 48789 3
3 185959 48791 3
4 83724 87211 50003
4 38022 87213 50003
5 196759 100003 76171
5 12634 100003 76173
6 12689 54281 100...

result:

ok 

Test #110:

score: 20
Accepted
time: 658ms
memory: 53052kb

input:

ba73dbf9c7d5e5202834d6a500541c
199996
47612 97612
29284 20722
30860 80858
2350 52348
49558 99558
33234 83232
9050 59048
92420 57584
4174 54172
42730 92728
72144 77860
69182 19182
77286 72716
43440 6566
57918 7918
35822 85822
24864 25142
87024 37024
96744 46746
29472 79472
28650 78648
26748 76746
253...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199995
0 58294 47613 97611
0 98733 47613 97613
1 54701 29283 20721
1 154430 29283 20723
2 102768 30861 80859
2 32658 30859 80859
3 28722 2351 52349
3 104033 2349 52349
4 36906 49559 99557
4 71657 49559 99559
5 98107 33235 83233
5 83246 33233 83233
6 1993...

result:

ok 

Test #111:

score: 20
Accepted
time: 746ms
memory: 57020kb

input:

ba73dbf9c7d5e5202834d6a500541c
196096
266 878
52 818
34 890
674 450
960 390
446 622
224 138
794 360
22 436
234 760
126 336
454 434
672 386
286 36
94 134
736 774
782 752
1014 692
228 594
778 878
550 1008
246 732
588 250
982 460
786 76
342 404
2 68
58 174
230 282
604 358
700 438
274 156
94 324
706 948...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
196095
0 170763 267 877
0 19723 265 879
0 168561 265 877
0 108894 267 879
1 20029 51 819
1 36004 53 819
2 73180 35 889
2 162524 33 891
2 152677 33 889
2 128182 35 891
3 130172 675 449
3 14140 673 451
3 115072 673 449
3 188238 675 451
4 27486 959 391
4 18...

result:

ok 

Test #112:

score: 20
Accepted
time: 649ms
memory: 59380kb

input:

ba73dbf9c7d5e5202834d6a500541c
175280
382 334
666 902
752 406
992 1306
1252 256
252 422
762 1018
72 210
1078 102
478 1182
1392 68
942 530
180 252
152 1176
2 594
52 182
522 1032
482 1386
242 260
242 276
112 572
782 138
762 1034
532 586
222 160
232 236
914 392
172 1006
612 1258
1170 832
1236 992
1370 ...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
175279
0 108584 383 333
0 60502 383 335
1 64711 665 903
1 76116 667 903
2 113581 753 405
2 105943 753 407
3 58325 993 1305
3 139936 993 1307
4 60050 1253 255
4 119978 1253 257
5 164014 253 421
5 109445 251 423
5 24116 251 421
5 30972 253 423
6 79649 763 ...

result:

ok 

Test #113:

score: 20
Accepted
time: 1ms
memory: 3980kb

input:

ba73dbf9c7d5e5202834d6a500541c
7
183572 142078
183572 142080
183568 142076
183574 142078
183574 142076
183568 142078
183570 142078

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
6
0 1 183573 142079
0 6 183571 142079
0 3 183573 142077
2 5 183569 142077
3 4 183575 142077
5 6 183569 142079

result:

ok 

Test #114:

score: 20
Accepted
time: 60ms
memory: 11956kb

input:

ba73dbf9c7d5e5202834d6a500541c
31065
186080 21286
185980 21532
185748 21002
185714 21252
185436 20722
186236 21564
185932 21236
185414 20700
185944 21578
185658 20936
185856 21540
186034 21122
186020 21492
186014 21310
185282 20638
185482 20878
185224 20682
185670 21264
186032 21510
186004 21112
185...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
31064
0 25501 186081 21285
0 14676 186079 21287
0 24707 186081 21287
1 13964 185979 21533
1 8222 185981 21533
2 22370 185747 21003
2 987 185749 21003
3 13657 185715 21251
3 25665 185715 21253
4 21012 185435 20723
4 4646 185437 20723
5 23081 186237 21563
...

result:

ok 

Test #115:

score: 20
Accepted
time: 20ms
memory: 5772kb

input:

ba73dbf9c7d5e5202834d6a500541c
20000
70262 161716
35896 78638
36020 78778
35780 78778
70374 161892
35858 78838
35908 78680
70376 161802
35886 78784
35858 78886
70436 161842
35884 78716
36030 78752
70344 161912
70270 161766
35868 78870
70276 161828
35806 78664
70330 161764
35978 78806
35850 78718
703...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #116:

score: 20
Accepted
time: 108ms
memory: 9916kb

input:

ba73dbf9c7d5e5202834d6a500541c
70000
101734 41174
53110 85692
125290 151418
53092 85668
125240 151526
101728 41006
155882 162620
70032 179926
125070 151314
69944 179838
125086 151362
101720 41088
125220 151418
78622 142762
70006 179900
78714 142782
53076 85646
78466 142806
156134 162652
69884 179760...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #117:

score: 20
Accepted
time: 216ms
memory: 14116kb

input:

ba73dbf9c7d5e5202834d6a500541c
120000
81980 29184
45086 128478
45130 128460
34094 161734
34312 161616
6660 133698
45032 128422
6464 133838
77706 149488
29744 82012
34066 161698
34152 161602
67876 16558
81992 29244
41026 168276
6594 133820
6410 133690
34300 161660
172610 38842
172506 38750
40990 1682...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #118:

score: 20
Accepted
time: 313ms
memory: 31040kb

input:

ba73dbf9c7d5e5202834d6a500541c
100000
21246 185820
20976 186272
21262 185900
20648 185812
21086 186086
20868 185712
21114 185810
21262 186168
20684 185892
20982 186216
20922 186194
21206 185654
20762 185796
21248 186200
21142 185850
21060 185510
20926 185746
21326 185710
20948 185798
21056 185958
21...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
99999
0 47260 21247 185819
0 7360 21247 185821
0 74580 21245 185821
1 80494 20977 186271
1 84678 20975 186273
1 26560 20977 186273
2 27098 21263 185899
2 22031 21261 185901
2 33027 21263 185901
3 37851 20649 185811
3 1271 20649 185813
4 40575 21085 18608...

result:

ok 

Test #119:

score: 20
Accepted
time: 442ms
memory: 37664kb

input:

ba73dbf9c7d5e5202834d6a500541c
125000
143578 113244
143620 112756
143600 113284
143670 113030
143848 113452
143654 113456
144176 112896
143982 112746
143648 112962
143542 113182
143954 113258
143500 112982
143960 113170
144016 112808
143802 112736
143952 112846
143364 112900
143658 112576
143632 112...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
124999
0 91943 143579 113245
0 19939 143577 113245
0 42763 143579 113243
1 69215 143619 112757
1 119521 143621 112757
2 8634 143599 113285
2 124313 143601 113285
3 28245 143671 113029
3 76772 143671 113031
4 87356 143849 113453
4 42370 143847 113453
5 12...

result:

ok 

Test #120:

score: 20
Accepted
time: 555ms
memory: 44536kb

input:

ba73dbf9c7d5e5202834d6a500541c
150000
115254 119710
115364 119296
115174 119288
115390 119648
115444 119620
115682 119260
115616 118782
114978 119008
115702 119260
115590 119250
115170 119030
115146 119308
115222 118958
114912 118972
115304 118678
115034 119388
115326 119348
115328 119082
115256 118...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
149999
0 107557 115255 119709
0 82102 115253 119711
0 45958 115255 119711
1 113329 115363 119297
1 52386 115365 119297
2 56672 115175 119287
2 37295 115175 119289
2 83038 115173 119289
3 137177 115391 119649
3 37998 115389 119649
3 53498 115391 119647
4 ...

result:

ok 

Test #121:

score: 20
Accepted
time: 738ms
memory: 51588kb

input:

ba73dbf9c7d5e5202834d6a500541c
175000
70684 45878
70722 45914
70572 45804
70996 46520
70150 46340
70360 46792
70818 45802
70460 46280
70946 46002
70154 46322
70894 46696
70710 46696
70120 46212
71042 46286
70194 46302
70624 45856
70434 46158
70936 46408
70870 46012
70790 45822
70470 45956
70136 4644...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
174999
0 27595 70685 45879
0 163275 70683 45879
0 171874 70685 45877
1 46778 70723 45915
1 122120 70723 45913
2 10296 70573 45803
2 150635 70573 45805
3 32548 70997 46519
3 93810 70997 46521
4 63614 70151 46339
4 40741 70149 46341
4 12312 70151 46341
5 1...

result:

ok 

Test #122:

score: 20
Accepted
time: 946ms
memory: 58324kb

input:

ba73dbf9c7d5e5202834d6a500541c
200000
120832 79932
121178 79254
120936 79156
121624 79142
121168 79430
121456 79722
121398 79244
121684 79344
121242 79718
121204 79394
121244 79174
121382 78964
121072 79288
121126 79078
121494 79378
121472 79306
121074 79832
121140 79956
121018 80010
121332 79428
12...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199999
0 34396 120833 79933
0 26581 120831 79933
0 4288 120833 79931
1 50809 121179 79253
1 137656 121179 79255
2 159993 120937 79155
2 131126 120935 79157
2 46533 120937 79157
3 134566 121625 79141
3 85658 121623 79143
3 64399 121625 79143
4 93530 12116...

result:

ok 

Subtask #6:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

0%