QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#521248#1142. Fountain Parkskimmoqt70 985ms138584kbC++207.2kb2024-08-16 01:47:102024-08-16 01:47:11

Judging History

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

  • [2024-08-16 01:47:11]
  • 评测
  • 测评结果:70
  • 用时:985ms
  • 内存:138584kb
  • [2024-08-16 01:47:10]
  • 提交

answer

#include "parks.h"

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

const int MX=2e5+5;

// bawah kiri atas kanan
const int dx[4]={-1,-1,-1,1},dy[4]={-1,-1,1,-1},ddx[4]={1,-1,1,1},ddy[4]={-1,1,1,1};

struct dsu {
        int par[MX];

        int find(int v) {
                return par[v]==v?v:par[v]=find(par[v]);
        }

        bool merge(int u, int v) {
                u=find(u),v=find(v);
                if(u==v) return false;
                par[u]=v;
                return true;
        }

        void prep() {
                for(int i=0;i<MX;i++) {
                        par[i]=i;
                }
        }
} ds;

vector<pair<int,int>> pos[MX];
set<int> st[MX];
vector<pair<int,int>> adj[MX];
vector<int> a,b,u,v;

map<array<int,4>,int> getId;
set<array<int,4>> edge;

map<pair<int,int>, int> cnt;
set<array<int,3>> S;

void add(int id, int x, int y) {
        assert(st[y].count(x));
        st[y].erase(x);
        a[id]=x;
        b[id]=y;
}

void upd(int x, int y, int coef) {
        if(st[y].count(x)) {
                S.erase({cnt[{x,y}],x,y});
                cnt[{x,y}]+=coef;
                S.insert({cnt[{x,y}],x,y});
        }
}

int construct_roads(std::vector<int> x, std::vector<int> y) {

        int N=x.size();
        int id=0;

        for(int i=0;i<N;i++) {
                pos[y[i]].push_back({x[i],i});
        }

        ds.prep();
        for(int i=0;i+2<MX;i+=2) {
                sort(pos[i].begin(),pos[i].end());

                for(int j=0;j+1<pos[i].size();j++) {
                        if(pos[i][j].first+2==pos[i][j+1].first) {
                                if(ds.merge(pos[i][j].second,pos[i][j+1].second)) {
                                        if(i>0) {
                                                st[i-1].insert(pos[i][j].first+1);
                                        }
                                        if(i+1<MX) {
                                                st[i+1].insert(pos[i][j].first+1);
                                        }
                                        adj[pos[i][j].second].push_back({pos[i][j+1].second,id});
                                        adj[pos[i][j+1].second].push_back({pos[i][j].second,id});
                                        id++;
                                }
                        }
                }

                if(!i) continue;
                if((i/2)&1) {
                        for(int j=pos[i].size()-1;j>=0;j--) {
                                auto it=lower_bound(pos[i-2].begin(),pos[i-2].end(),make_pair(pos[i][j].first,0));
                                if(it!=pos[i-2].end() && it->first==pos[i][j].first) {
                                        if(ds.merge(pos[i][j].second,it->second)) {
                                                st[i-1].insert(it->first-1);
                                                st[i-1].insert(it->first+1);
                                                adj[pos[i][j].second].push_back({it->second,id});
                                                adj[it->second].push_back({pos[i][j].second,id});
                                                id++;
                                        }
                                }
                        }
                } else {
                        for(int j=0;j<pos[i].size();j++) {
                                auto it=lower_bound(pos[i-2].begin(),pos[i-2].end(),make_pair(pos[i][j].first,0));
                                if(it!=pos[i-2].end() && it->first==pos[i][j].first) {
                                        if(ds.merge(pos[i][j].second,it->second)) {
                                                st[i-1].insert(it->first-1);
                                                st[i-1].insert(it->first+1);
                                                adj[pos[i][j].second].push_back({it->second,id});
                                                adj[it->second].push_back({pos[i][j].second,id});
                                                id++;
                                        }
                                }
                        }
                }
        }

        for(int i=0;i<N;i++) {
                if(ds.find(i)!=ds.find(0)) return 0;
        }

        a.assign(id,-1);
        b.assign(id,-1);
        u.assign(id,-1);
        v.assign(id,-1);

        for(int i=0;i<N;i++) {
                for(auto [j,id]:adj[i]) {
                        if(i>j) continue;
                        u[id]=i;
                        v[id]=j;
                        getId[{min(x[i],x[j]),max(x[i],x[j]),min(y[i],y[j]),max(y[i],y[j])}]=id;
                        edge.insert({min(x[i],x[j]),max(x[i],x[j]),min(y[i],y[j]),max(y[i],y[j])});
                }
        }

        for(int i=0;i<N;i++) {
                if(adj[i].size()==4) {
                        for(auto [j,id]:adj[i]) {
                                if(x[j]==x[i]-2) {
                                        add(id,x[i]-1,y[i]-1);
                                }
                                if(y[j]==y[i]+2) {
                                        add(id,x[i]-1,y[i]+1);
                                }
                                if(x[j]==x[i]+2) {
                                        add(id,x[i]+1,y[i]+1);
                                }
                                if(y[j]==y[i]-2) {
                                        add(id,x[i]+1,y[i]-1);
                                }       
                                edge.erase({min(x[i],x[j]),max(x[i],x[j]),min(y[i],y[j]),max(y[i],y[j])});
                        }

                }
        }

        for(int i=0;i<MX;i++) {
                for(auto j:st[i]) {
                        S.insert({0,j,i});
                }
        }

        for(auto [ax,bx,ay,by]:edge) {
                if(ax==bx) {
                        upd(ax-1,ay+1,1);
                        upd(ax+1,ay+1,1);
                } else {
                        upd(ax+1,ay+1,1);
                        upd(ax+1,ay-1,1);
                }
        }

        while(S.size()) {
                auto [c,x,y]=*S.begin();
                S.erase(S.begin());

                for(int k=0;k<4;k++) {
                        int ax=x+dx[k],bx=x+ddx[k],ay=y+dy[k],by=y+ddy[k];
                        if(ax>bx) swap(ax,bx);
                        if(ay>by) swap(ay,by);

                        if(edge.count({ax,bx,ay,by})) {
                                edge.erase({ax,bx,ay,by});
                                add(getId[{ax,bx,ay,by}],x,y);

                                if(ax==bx) {
                                        upd(ax-1,ay+1,-1);
                                        upd(ax+1,ay+1,-1);
                                } else {
                                        upd(ax+1,ay+1,-1);
                                        upd(ax+1,ay-1,-1);
                                }
                                break;
                        }
                }

                if(st[y].count(x)) st[y].erase(x);
        }

        build(u, v, a, b);
        return 1;
}

詳細信息

Subtask #1:

score: 5
Accepted

Test #1:

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

input:

ba73dbf9c7d5e5202834d6a500541c
1
2 2

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
0

result:

ok 

Test #2:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 2
2 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
1
0 1 1 3

result:

ok 

Test #3:

score: 5
Accepted
time: 4ms
memory: 18556kb

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 2
2 6

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #4:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 2
2 4
2 6

output:

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

result:

ok 

Test #5:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
2 2
2 4
2 6
2 8

output:

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

result:

ok 

Test #6:

score: 5
Accepted
time: 3ms
memory: 17064kb

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 2
2 4
2 8

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #7:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
2 2
2 4
2 8
2 10

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #8:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
2 2
2 4
2 6
2 10

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #9:

score: 5
Accepted
time: 428ms
memory: 81872kb

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
13952 31503 1 3
31503 34333 1 5
11184 34333 1 7
11184 42839 1 9
39415 42839 1 11
39415 76798 1 13
20588 76798 1 15
20588 37623 1 17
30774 37623 1 19
21798 30774 1 21
21798 81338 1 23
35924 81338 1 25
35924 98098 1 27
4388 98098 1 29
4388 94082 1 31...

result:

ok 

Test #10:

score: 5
Accepted
time: 27ms
memory: 22184kb

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 1 3125
1 2 1 3127
2 3 1 3129
3 4 1 3131
4 5 1 3133
5 6 1 3135
6 7 1 3137
7 8 1 3139
8 9 1 3141
9 10 1 3143
10 11 1 3145
11 12 1 3147
12 13 1 3149
13 14 1 3151
14 15 1 3153
15 16 1 3155
16 17 1 3157
17 18 1 3159
18 19 1 3161
19 20 1 3163
20 21 1 ...

result:

ok 

Test #11:

score: 5
Accepted
time: 210ms
memory: 50792kb

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 1 3567
1 2 1 3569
2 3 1 3571
3 4 1 3573
4 5 1 3575
5 6 1 3577
6 7 1 3579
7 8 1 3581
8 9 1 3583
9 10 1 3585
10 11 1 3587
11 12 1 3589
12 13 1 3591
13 14 1 3593
14 15 1 3595
15 16 1 3597
16 17 1 3599
17 18 1 3601
18 19 1 3603
19 20 1 3605
20 21 1...

result:

ok 

Test #12:

score: 5
Accepted
time: 41ms
memory: 23952kb

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 1 4955
1 2 1 4957
2 3 1 4959
3 4 1 4961
4 5 1 4963
5 6 1 4965
6 7 1 4967
7 8 1 4969
8 9 1 4971
9 10 1 4973
10 11 1 4975
11 12 1 4977
12 13 1 4979
13 14 1 4981
14 15 1 4983
15 16 1 4985
16 17 1 4987
17 18 1 4989
18 19 1 4991
19 20 1 4993
20 21 1...

result:

ok 

Test #13:

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

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: 17116kb

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: 4ms
memory: 17348kb

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: 432ms
memory: 80352kb

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
74843 82261 1 3
8766 74843 1 5
8766 52706 1 7
50332 52706 1 9
50332 87757 1 11
87757 96100 1 13
10691 96100 1 15
10691 67720 1 17
56430 67720 1 19
56430 82376 1 21
82376 85275 1 23
77807 85275 1 25
58592 77807 1 27
58592 63926 1 29
32662 63926 1 31...

result:

ok 

Subtask #2:

score: 10
Accepted

Dependency #1:

100%
Accepted

Test #17:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
4 4
2 4
4 2
2 2

output:

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

result:

ok 

Test #18:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
4 4
2 6
2 4
4 6

output:

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

result:

ok 

Test #19:

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

input:

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

output:

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

result:

ok 

Test #20:

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

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

result:

ok 

Test #21:

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

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: 0ms
memory: 15168kb

input:

ba73dbf9c7d5e5202834d6a500541c
4
2 200000
4 199998
2 199998
4 200000

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
3
1 2 3 199997
0 3 3 199999
0 2 1 199999

result:

ok 

Test #23:

score: 10
Accepted
time: 781ms
memory: 104204kb

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
87387 131304 3 1
169794 174493 3 3
87387 174493 1 3
49998 136703 3 5
49998 169794 5 5
23481 193595 3 7
136703 193595 1 7
28659 190796 3 9
23481 190796 5 9
151433 171330 3 11
28659 171330 1 11
126146 148362 3 13
148362 151433 5 13
10708 184900 3 15...

result:

ok 

Test #24:

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

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 1 3 183569
2 3 3 183571
0 3 1 183571
2 5 3 183573
6 7 3 183577
5 7 3 183575
4 6 1 183577

result:

ok 

Test #25:

score: 10
Accepted
time: 6ms
memory: 17420kb

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
880 1021 3 185597
745 851 3 185599
745 1021 1 185599
720 1035 3 185601
851 1035 5 185601
26 1155 3 185603
720 1155 1 185603
187 593 3 185605
26 593 5 185605
40 819 3 185607
187 819 1 185607
979 1069 3 185609
40 1069 5 185609
72 1148 3 185611
979 114...

result:

ok 

Test #26:

score: 10
Accepted
time: 5ms
memory: 17384kb

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: 17608kb

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: 274ms
memory: 49932kb

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
35158 36483 3 1
33333 33964 3 3
33964 35158 1 3
56823 64060 3 5
33333 56823 5 5
3654 23171 3 7
3654 64060 1 7
52126 58574 3 9
23171 58574 5 9
4938 8365 3 11
4938 52126 1 11
6988 7109 3 13
7109 8365 5 13
50880 62140 3 15
6988 62140 1 15
9254 32239 3...

result:

ok 

Test #29:

score: 10
Accepted
time: 411ms
memory: 70596kb

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
3416 71671 1 80001
46985 96497 3 80003
46985 71671 1 80003
77792 89055 3 80005
77792 96497 5 80005
35747 79357 3 80007
79357 89055 1 80007
42544 71793 3 80009
35747 42544 5 80009
57759 60256 3 80011
57759 71793 1 80011
20411 71136 3 80013
60256 71...

result:

ok 

Test #30:

score: 10
Accepted
time: 630ms
memory: 86824kb

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
39354 140728 3 40001
131089 159895 3 40003
140728 159895 1 40003
60919 116824 3 40005
60919 131089 5 40005
26002 158731 3 40007
26002 116824 1 40007
10395 79174 3 40009
79174 158731 5 40009
104968 154289 3 40011
10395 104968 1 40011
22190 144168 3...

result:

ok 

Test #31:

score: 10
Accepted
time: 779ms
memory: 104324kb

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
5266 49531 3 1
157693 178918 3 3
49531 157693 1 3
17023 51820 3 5
17023 178918 5 5
22149 90232 3 7
22149 51820 1 7
84790 90756 3 9
84790 90232 5 9
148747 150246 3 11
90756 148747 1 11
75269 109158 3 13
75269 150246 5 13
51959 192499 3 15
109158 19...

result:

ok 

Test #32:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
4 2
4 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
1
0 1 3 3

result:

ok 

Test #33:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 2
4 2

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
1
0 1 3 1

result:

ok 

Test #34:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 4
4 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
1
0 1 3 3

result:

ok 

Test #35:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 2
4 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #36:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 4
4 2

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #37:

score: 10
Accepted
time: 4ms
memory: 17220kb

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 2
2 4
4 2

output:

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

result:

ok 

Test #38:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 2
2 4
4 4

output:

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

result:

ok 

Test #39:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 2
4 2
4 4

output:

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

result:

ok 

Test #40:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 4
4 2
4 4

output:

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

result:

ok 

Test #41:

score: 10
Accepted
time: 4ms
memory: 18728kb

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 4
4 2
4 6

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #42:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 200000
2 199998
4 200000

output:

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

result:

ok 

Test #43:

score: 10
Accepted
time: 4ms
memory: 17520kb

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: 4ms
memory: 17464kb

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: 349ms
memory: 69884kb

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
37166 82931 3 62141
15918 37166 3 62139
72659 82931 1 62141
19421 38445 3 62143
38445 72659 1 62143
38445 47840 1 62145
6134 81597 3 62147
6134 47840 1 62147
15165 81597 3 62149
9792 27351 3 62151
9792 15165 5 62151
9792 98642 3 62153
71902 98642 3...

result:

ok 

Test #46:

score: 10
Accepted
time: 544ms
memory: 91856kb

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
18304 70440 3 3
18304 59075 1 3
70440 142421 3 5
6184 9398 3 7
9398 142421 5 7
9398 75936 3 9
43370 75936 3 11
75692 92983 3 13
43370 75692 5 13
40525 75692 3 15
106115 110228 3 19
40525 110228 3 17
51449 106115 1 19
129446 135395 3 21
51449 12944...

result:

ok 

Test #47:

score: 10
Accepted
time: 555ms
memory: 91768kb

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
8228 42574 3 1
42574 55747 1 3
77348 96449 3 5
55747 96449 1 5
96449 120955 1 7
109902 120955 1 9
91793 112023 3 11
91793 109902 1 11
112023 114433 3 13
329 7123 3 15
7123 114433 5 15
7123 49437 3 17
60913 99850 3 19
49437 99850 5 19
63867 99850 3...

result:

ok 

Subtask #3:

score: 15
Accepted

Dependency #2:

100%
Accepted

Test #48:

score: 15
Accepted
time: 5ms
memory: 18284kb

input:

ba73dbf9c7d5e5202834d6a500541c
4
6 2
4 2
6 4
4 4

output:

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

result:

ok 

Test #49:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
6 6
4 4
6 4
4 6

output:

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

result:

ok 

Test #50:

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

input:

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

output:

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

result:

ok 

Test #51:

score: 15
Accepted
time: 3ms
memory: 17200kb

input:

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

output:

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

result:

ok 

Test #52:

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

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

result:

ok 

Test #53:

score: 15
Accepted
time: 3ms
memory: 16868kb

input:

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

output:

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

result:

ok 

Test #54:

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

input:

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

output:

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

result:

ok 

Test #55:

score: 15
Accepted
time: 784ms
memory: 103080kb

input:

ba73dbf9c7d5e5202834d6a500541c
199998
6 95048
2 124620
6 92330
2 87562
4 64650
2 76818
6 94884
6 106050
2 87068
2 36890
4 118972
4 58310
2 59538
6 30350
4 14668
2 71226
4 83464
6 1438
2 63320
6 130540
6 20760
2 11738
6 121604
6 69304
2 35164
4 1904
6 63076
4 116444
6 96292
2 5438
6 16630
4 14906
6 8...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199997
174784 180833 3 1
46055 174784 5 1
10609 126224 3 3
10609 14702 5 3
126224 180833 1 3
83881 198084 3 5
31589 198084 5 5
14702 31589 7 5
42857 138308 3 7
32411 42857 5 7
83881 138308 1 7
860 113233 3 9
860 66966 5 9
32411 66966 7 9
63388 79947 3 11...

result:

ok 

Test #56:

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

input:

ba73dbf9c7d5e5202834d6a500541c
10
6 183572
4 183572
4 183574
2 183576
6 183576
4 183576
2 183578
6 183570
2 183572
4 183570

output:

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

result:

ok 

Test #57:

score: 15
Accepted
time: 3ms
memory: 15512kb

input:

ba73dbf9c7d5e5202834d6a500541c
1758
2 186528
2 185930
6 186026
4 185782
4 185694
4 186150
4 186018
2 186238
4 185950
4 185628
2 186334
6 185770
2 186482
4 186156
6 185842
6 186334
2 186232
2 186656
2 185904
4 186764
4 186076
2 185806
6 185650
4 185836
2 186226
4 186546
4 185606
2 186302
2 186044
4 1...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
1757
395 1070 5 185597
880 1328 3 185599
732 880 5 185601
880 1070 5 185599
1329 1342 3 185601
1342 1601 5 185603
732 1601 7 185601
720 1510 3 185603
163 1510 5 185605
720 1329 1 185603
26 1155 3 185605
26 1093 5 185607
163 1093 7 185605
593 1553 3 18560...

result:

ok 

Test #58:

score: 15
Accepted
time: 16ms
memory: 17120kb

input:

ba73dbf9c7d5e5202834d6a500541c
6000
4 91732
4 90280
6 89008
2 91010
6 91888
4 90450
6 90196
6 90416
4 90156
6 91718
6 88708
6 89872
2 91232
2 91566
2 90018
2 89016
4 90382
2 88900
6 91918
4 89424
4 88672
2 89576
4 90656
6 88592
2 91610
2 90672
4 89684
2 91674
2 90820
2 91412
6 90820
2 91702
2 89464
...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
5999
3047 3286 5 88149
3787 4941 5 88151
3286 4941 3 88151
935 5513 3 88153
935 3763 5 88153
3763 3787 7 88153
644 4637 3 88155
4637 4964 5 88155
644 5513 1 88155
2120 3966 3 88157
2120 3937 5 88157
3937 4964 7 88157
1027 3598 3 88159
1027 1871 5 88159
3...

result:

ok 

Test #59:

score: 15
Accepted
time: 3ms
memory: 16316kb

input:

ba73dbf9c7d5e5202834d6a500541c
10000
2 85892
4 103848
4 55116
2 75724
6 178108
2 178416
6 104794
6 104736
6 54334
4 76036
4 86888
4 178912
4 86578
2 85994
6 74754
2 178168
4 103636
6 179140
4 75786
4 86246
6 85520
4 178886
6 104314
6 104818
6 74798
2 104170
4 103618
2 179026
2 178698
6 75788
2 54676...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #60:

score: 15
Accepted
time: 339ms
memory: 60160kb

input:

ba73dbf9c7d5e5202834d6a500541c
100000
6 4304
4 17988
4 43862
6 2282
6 37606
2 66400
2 11222
2 26524
2 66522
6 29288
2 54226
2 45692
4 66428
4 22820
6 65310
2 50814
2 8860
6 48664
2 40386
4 54982
2 23044
4 31694
4 6372
6 38602
2 9752
4 32596
6 53798
4 49586
2 24848
6 23096
6 40944
2 48824
6 16910
6 6...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
99999
52352 95881 3 1
48139 95881 5 1
28857 97931 3 3
28857 40010 5 3
52352 97931 1 3
38222 83537 3 5
35929 83537 5 5
35929 40010 7 5
10373 86929 3 7
10373 85657 5 7
38222 86929 1 7
1687 80656 3 9
1687 16808 5 9
16808 85657 7 9
9113 17742 3 11
9113 60692...

result:

ok 

Test #61:

score: 15
Accepted
time: 468ms
memory: 74416kb

input:

ba73dbf9c7d5e5202834d6a500541c
135000
4 80108
4 55532
6 15996
2 55940
6 40018
4 78816
6 35830
6 17658
2 86938
4 83772
2 72238
6 5506
6 61968
2 58268
6 43876
2 23076
4 27904
4 89178
6 35424
6 35176
4 89584
2 78888
6 7010
6 12638
2 42660
4 44862
6 60734
4 79580
2 74128
2 18674
2 19372
6 73860
6 54040
...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
134999
50510 65274 3 1
50510 73127 5 1
40799 131078 3 3
40799 122007 5 3
65274 131078 1 3
118658 127198 3 5
22074 127198 5 5
22074 122007 7 5
46772 49021 3 7
46423 46772 5 7
49021 118658 1 7
33463 125787 3 9
16424 125787 5 9
16424 46423 7 9
6238 20516 3 ...

result:

ok 

Test #62:

score: 15
Accepted
time: 577ms
memory: 89336kb

input:

ba73dbf9c7d5e5202834d6a500541c
165000
6 172066
4 138088
2 134464
6 123142
4 170926
2 117864
2 185690
6 179060
6 187756
6 91450
4 92788
6 97334
6 134770
6 139588
2 121126
4 136832
4 197742
6 100388
6 91908
2 109104
6 106976
2 107942
4 142116
4 115082
2 113344
6 172824
6 110544
6 112464
4 149004
6 175...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
164999
70411 164853 3 89293
35258 164853 5 89293
125160 143638 3 89295
70411 125160 1 89295
35137 65759 3 89299
35137 143638 3 89297
61785 76006 3 89301
41452 61785 5 89299
65759 76006 1 89299
105598 114310 3 89303
105598 150630 5 89301
41452 150630 7 89...

result:

ok 

Test #63:

score: 15
Accepted
time: 734ms
memory: 103808kb

input:

ba73dbf9c7d5e5202834d6a500541c
200000
6 86562
2 132164
2 161960
4 166102
4 94656
6 164844
6 45856
2 99300
4 77424
6 76788
6 162328
4 78372
4 103764
4 140704
6 127746
4 169652
4 96084
4 49796
6 172202
6 104484
4 167568
4 176392
6 129104
4 49314
4 56440
6 102854
4 59986
6 118008
6 145490
6 74630
4 788...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199999
59954 179200 3 43451
99824 179200 1 43451
66640 179200 1 43453
76512 111299 3 43455
66986 111299 5 43455
66640 76512 1 43455
88037 196835 3 43457
77908 196835 5 43457
66986 77908 7 43457
19055 185839 3 43459
88181 185839 5 43459
19055 88037 1 4345...

result:

ok 

Test #64:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 2
6 2

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #65:

score: 15
Accepted
time: 3ms
memory: 14872kb

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 2
4 2
6 2

output:

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

result:

ok 

Test #66:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
2 4
4 2
4 6
6 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #67:

score: 15
Accepted
time: 985ms
memory: 138488kb

input:

ba73dbf9c7d5e5202834d6a500541c
199999
2 115866
2 154134
2 3960
6 59348
6 111954
6 53896
2 15912
6 199914
2 163078
6 49868
2 137758
2 48042
2 69990
2 70364
2 133946
2 34468
2 130622
2 15364
6 196702
6 46780
2 128410
6 18592
6 4278
6 133068
6 142246
6 26900
6 43072
2 122198
6 124978
2 159380
2 85902
2...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199998
57783 81797 5 5
4082 9442 1 5
9442 102483 1 7
57783 64489 5 7
64489 136265 5 9
102483 107659 1 9
89890 107659 1 11
136265 161909 5 11
127429 161909 5 13
20566 89890 1 13
20566 56149 1 15
127429 148691 5 15
146093 148691 5 17
56149 167521 1 17
1675...

result:

ok 

Test #68:

score: 15
Accepted
time: 965ms
memory: 138584kb

input:

ba73dbf9c7d5e5202834d6a500541c
199999
2 90630
6 168226
6 175968
2 130260
2 126026
6 119368
6 52682
6 64202
6 70518
2 170700
2 21860
2 178410
2 76192
2 38016
6 199270
6 23782
2 192152
2 106458
2 80892
6 163314
2 106656
6 49920
6 157054
2 136682
2 55556
2 79540
2 106102
6 88696
6 7678
2 52468
2 172280...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199998
7507 116349 3 3
73218 116349 5 3
51005 73218 5 5
7507 43994 1 5
37535 43994 1 7
23373 51005 5 7
23373 53204 5 9
37030 37535 1 9
37030 65598 1 11
53204 105850 5 11
105850 174175 5 13
15170 65598 1 13
15170 150001 1 15
150761 174175 5 15
16907 15076...

result:

ok 

Test #69:

score: 15
Accepted
time: 885ms
memory: 137792kb

input:

ba73dbf9c7d5e5202834d6a500541c
199005
6 34654
2 127948
6 190536
6 15644
2 120332
6 178698
6 3046
6 62338
6 12832
6 2824
2 48818
2 44152
6 71348
6 58418
2 151464
6 152242
2 111332
6 138662
6 146622
2 110626
6 6934
2 39908
2 108378
6 21936
6 164090
6 15418
2 36712
6 81888
6 146740
6 199770
6 158344
6 ...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199004
51358 167926 3 1
167926 169073 5 1
51358 139409 1 3
138789 169073 5 3
34283 138789 5 5
52907 139409 1 5
52907 162481 1 7
34283 44926 5 7
42245 44926 5 9
162481 175750 1 9
1419 175750 1 11
42245 113220 5 11
89975 113220 5 13
1419 138968 1 13
128763...

result:

ok 

Test #70:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4000
6 103928
6 191558
6 192994
6 104234
6 104228
6 192602
6 191276
6 192742
6 102730
6 102798
2 102814
2 191852
4 193088
2 192554
2 191866
6 192580
2 102534
2 104064
4 102812
4 103152
4 104060
6 104430
4 192606
6 192594
6 191350
2 103266
2 191778
2 191878
6 192648
2 1...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #71:

score: 15
Accepted
time: 3ms
memory: 18292kb

input:

ba73dbf9c7d5e5202834d6a500541c
8000
6 141670
6 184016
6 5642
4 184462
4 7172
4 185262
2 127694
6 184208
2 127008
6 5812
2 141736
6 184706
2 141928
6 141792
2 6068
2 7032
6 142914
2 127674
6 184572
2 143142
2 127594
2 128398
6 5628
6 5856
4 143130
6 6290
4 184104
4 142184
6 141864
4 7106
4 127108
2 1...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #72:

score: 15
Accepted
time: 343ms
memory: 63720kb

input:

ba73dbf9c7d5e5202834d6a500541c
100000
6 42836
2 5972
2 35490
6 39484
4 28614
2 35194
2 2202
4 80528
4 30536
4 90140
6 92102
6 54632
6 34240
4 84986
4 37206
4 64602
2 43952
6 49232
4 9034
2 67488
4 54660
2 16758
4 25776
2 89570
2 39854
2 16688
2 71262
6 79192
2 46376
2 47100
4 63702
2 10200
6 30688
2...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
99999
21754 72670 3 3
11289 72670 1 3
10528 62707 5 5
21754 62707 3 5
26634 67648 3 9
62707 67648 3 7
26634 93783 1 9
3737 93783 1 11
14277 54648 5 11
7480 7870 3 13
7480 35840 5 13
35840 54648 7 13
3737 7870 1 13
7870 50498 1 15
35687 35840 5 15
35687 6...

result:

ok 

Test #73:

score: 15
Accepted
time: 553ms
memory: 90716kb

input:

ba73dbf9c7d5e5202834d6a500541c
150000
6 78236
4 79810
4 91776
2 64708
4 102410
4 70544
2 103230
6 172210
4 115452
6 112350
4 54632
4 94094
2 70820
2 136734
6 59966
6 63288
6 158212
4 183616
2 142072
6 84484
2 184338
4 197862
2 96278
6 120562
2 66086
4 97884
6 115196
2 176864
6 138738
2 173644
6 1435...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
149999
111283 115353 5 53969
115353 133819 3 53969
111283 122260 5 53971
23916 117290 5 53975
117290 122260 5 53973
38014 49915 3 53977
23916 49915 3 53975
47393 129162 5 53979
47393 49915 5 53977
36998 72764 3 53981
36998 47393 3 53979
10318 107636 5 53...

result:

ok 

Test #74:

score: 15
Accepted
time: 768ms
memory: 113536kb

input:

ba73dbf9c7d5e5202834d6a500541c
200000
4 87744
2 105360
6 34704
2 171792
4 20694
6 25286
4 111544
6 25068
6 64900
2 15046
6 42920
2 56676
6 73896
6 62404
4 12270
4 170618
4 53634
2 178476
4 16464
6 188544
6 76360
4 15978
4 121632
4 38548
6 17998
2 106472
2 152492
2 70066
2 137378
4 55310
4 110092
2 9...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199999
9631 112023 3 5085
40274 155383 3 5089
9631 155383 3 5087
40274 177260 1 5089
64652 177260 1 5091
149955 193632 5 5091
168514 196585 3 5093
57693 168514 5 5095
57693 193632 5 5093
64652 196585 1 5093
132257 196585 1 5095
188493 191134 3 5097
80652...

result:

ok 

Test #75:

score: 15
Accepted
time: 769ms
memory: 117672kb

input:

ba73dbf9c7d5e5202834d6a500541c
199998
2 4288
6 133692
4 30182
2 60312
4 47290
6 120388
2 130714
6 53616
4 91442
6 58218
6 71180
2 104478
6 57206
2 86644
2 93842
4 10502
2 92832
2 136286
6 157256
4 13610
4 148186
4 43542
2 18784
4 103326
4 15658
6 60290
2 23282
6 85690
6 148178
2 59640
2 84698
2 7120...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199997
143177 198668 3 1
141008 143177 5 1
100317 198668 1 3
16618 141008 5 3
102540 197689 3 5
45277 102540 5 5
16618 45277 7 5
25068 197689 1 7
45277 144808 5 7
77200 184499 3 9
20335 77200 5 9
20335 144808 7 9
66839 184499 1 11
20335 49282 5 11
152416...

result:

ok 

Test #76:

score: 15
Accepted
time: 906ms
memory: 138504kb

input:

ba73dbf9c7d5e5202834d6a500541c
200000
2 129082
6 72610
6 194734
2 112750
6 82944
6 30138
6 15770
6 183396
2 154782
2 193764
2 194778
2 166484
2 193426
2 188262
2 145992
2 174192
6 123650
6 7554
2 119606
6 29826
6 67290
6 85018
2 126458
6 98598
6 55728
2 19416
2 57930
6 51516
6 193690
6 149696
6 6076...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199999
74259 191221 3 3
74259 103605 5 3
38718 103605 5 5
92133 191221 1 5
92133 192115 1 7
38718 137332 5 7
64773 137332 5 9
31300 192115 1 9
31300 177610 1 11
64773 151232 5 11
150912 151232 5 13
98086 177610 1 13
65615 98086 1 15
115245 150912 5 15
93...

result:

ok 

Test #77:

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

input:

ba73dbf9c7d5e5202834d6a500541c
5000
4 156154
4 156368
2 196426
6 156928
6 196174
6 196750
4 197822
4 157596
6 197540
6 156240
6 157920
4 156878
6 158036
4 157232
4 196778
6 197648
6 198212
2 196894
2 197104
6 157446
4 158124
4 157874
4 158094
2 156192
2 157168
4 156104
6 156272
2 156800
6 156712
4 1...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #78:

score: 15
Accepted
time: 3ms
memory: 18412kb

input:

ba73dbf9c7d5e5202834d6a500541c
9000
4 170344
4 169674
2 32968
6 32518
6 169052
6 32668
6 167364
6 170438
2 113068
6 113654
6 169248
2 73998
2 113724
4 168816
6 114556
6 73758
6 169778
2 114014
4 168766
6 32746
4 33158
2 168994
6 113252
2 167962
2 74106
6 74430
2 33446
6 113268
4 167946
2 169548
6 16...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #79:

score: 15
Accepted
time: 314ms
memory: 63924kb

input:

ba73dbf9c7d5e5202834d6a500541c
100000
6 66826
6 39954
2 73296
2 75802
2 4612
4 61128
6 31252
6 31446
4 40332
2 9172
4 71820
6 84754
4 21092
6 61782
6 64606
6 51960
2 83080
2 19798
2 58636
2 87918
2 47708
4 11814
4 23664
2 50458
6 40382
2 63084
4 9814
2 72088
2 50462
4 50442
4 77972
6 1870
2 30758
2 ...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
99999
71883 73441 5 1
53920 83787 3 5
53920 71883 3 3
22753 83787 1 5
22753 75514 1 7
41347 45460 5 7
10838 55327 3 9
10838 68751 5 9
41347 68751 7 9
55327 75514 1 9
55327 73589 1 11
68751 93530 5 11
22638 51899 3 13
22638 85438 5 15
85438 93530 5 13
226...

result:

ok 

Test #80:

score: 15
Accepted
time: 543ms
memory: 88832kb

input:

ba73dbf9c7d5e5202834d6a500541c
150000
2 174028
4 144676
2 118168
6 186418
4 106026
2 169150
4 190940
2 67752
2 196266
4 96144
2 124170
2 82348
4 155326
6 144152
6 108674
2 127704
6 147302
2 94080
6 88216
4 121306
6 148108
2 73550
4 122830
6 112894
6 98012
2 195176
2 82024
6 152408
2 72600
4 80088
4 ...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
149999
95691 111000 5 65619
8287 111000 5 65621
79472 81133 3 65623
36967 79472 5 65623
31501 81133 1 65623
8287 36967 7 65623
36967 133612 5 65625
81133 137007 1 65625
852 64484 3 65627
3543 64484 5 65627
852 137007 1 65627
3543 91458 5 65629
852 64042 ...

result:

ok 

Test #81:

score: 15
Accepted
time: 769ms
memory: 113372kb

input:

ba73dbf9c7d5e5202834d6a500541c
200000
2 52140
2 66722
6 68358
4 184262
6 44806
6 104740
4 58058
6 25488
6 29594
4 52850
6 130906
6 55904
2 160352
6 116632
4 52134
6 137734
2 180134
2 106380
6 114282
2 194328
6 79594
6 184894
2 42778
2 102758
6 144008
6 50926
6 119278
4 128810
4 21484
2 134002
6 1561...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199999
17366 190650 3 20639
83072 190650 5 20639
15795 17366 1 20639
83072 94650 7 20639
23263 83072 5 20641
17366 40322 1 20641
90797 157810 3 20643
90797 104006 5 20643
40322 157810 1 20643
52053 104006 5 20645
157810 183397 1 20645
17198 101802 3 2064...

result:

ok 

Subtask #4:

score: 20
Accepted

Test #82:

score: 20
Accepted
time: 4ms
memory: 16760kb

input:

ba73dbf9c7d5e5202834d6a500541c
3
200000 2
200000 4
199998 2

output:

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

result:

ok 

Test #83:

score: 20
Accepted
time: 3ms
memory: 14888kb

input:

ba73dbf9c7d5e5202834d6a500541c
3
200000 200000
200000 199998
199998 200000

output:

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

result:

ok 

Test #84:

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

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: 637ms
memory: 104220kb

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
15469 166733 199999 5
131676 166733 199999 3
169714 197756 199997 7
15469 169714 199997 5
77386 149704 199995 9
77386 197756 199995 7
47443 115753 199993 11
47443 149704 199993 9
23563 42395 199991 13
42395 115753 199991 11
110908 185899 199989 15...

result:

ok 

Test #86:

score: 20
Accepted
time: 644ms
memory: 102980kb

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
113948 162590 5 3
96089 162590 7 3
34265 96089 9 3
56476 120029 11 5
34265 56476 9 5
113948 165294 3 5
14774 195107 13 7
18854 165294 3 7
14774 120029 11 7
23669 63414 5 9
20924 52918 15 9
20924 195107 13 9
18854 23669 3 9
8148 152046 7 11
40406 6...

result:

ok 

Test #87:

score: 20
Accepted
time: 646ms
memory: 103048kb

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
143432 160616 99999 3
57526 143432 100001 3
93 57526 100003 3
49323 112312 99997 7
93 95983 100003 5
49323 160616 99997 5
36711 143617 99995 9
36711 112312 99995 7
95983 158692 100003 7
76526 191001 99993 11
13359 152279 100003 11
13359 158692 100...

result:

ok 

Test #88:

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

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
138877 155301 3 1
138877 161377 5 1
137783 161377 7 1
132135 137783 9 1
105513 132135 11 1
105513 139087 13 1
68934 139087 15 1
20134 68934 17 1
20134 43320 19 1
43320 70385 21 1
14288 70385 23 1
14288 18052 25 1
18052 159112 27 1
53171 159112 29 ...

result:

ok 

Test #89:

score: 20
Accepted
time: 29ms
memory: 21860kb

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: 77ms
memory: 51116kb

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: 93ms
memory: 50932kb

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: 901ms
memory: 133192kb

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
82235 150912 3 1
67693 150912 5 1
67693 148587 7 1
105901 148587 9 1
67131 105901 11 1
67131 89322 13 1
89322 146130 15 1
126588 146130 17 1
44673 126588 19 1
44673 111675 21 1
89043 111675 23 1
56820 89043 25 1
56820 187535 27 1
2863 187535 29 1
...

result:

ok 

Test #93:

score: 20
Accepted
time: 950ms
memory: 134428kb

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
73927 88401 1597 5
433 31746 1593 5
35895 90461 1589 5
37966 51007 1585 5
29703 140163 1581 5
44176 177690 1577 5
34370 139453 1573 5
71501 154942 1569 5
70899 155559 1565 5
87482 198814 1561 5
3081 40495 1557 5
100790 168856 1553 5
133550 150101 ...

result:

ok 

Test #94:

score: 20
Accepted
time: 949ms
memory: 133972kb

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
13984 101402 3 1
75367 101402 5 1
75367 156557 7 1
10757 156557 9 1
10757 47255 11 1
47255 138412 13 1
53007 138412 15 1
6220 53007 17 1
6220 100285 19 1
66774 100285 21 1
66774 171543 23 1
163244 171543 25 1
100299 163244 27 1
2178 100299 29 1
21...

result:

ok 

Test #95:

score: 20
Accepted
time: 950ms
memory: 134028kb

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
24987 48613 5 1
24987 184216 7 1
11021 184216 9 1
5103 11021 11 1
5103 169354 13 1
37528 169354 15 1
37528 107597 17 1
16519 107597 19 1
16519 79333 21 1
43437 79333 23 1
43437 141732 25 1
128909 141732 27 1
32344 128909 29 1
32344 199313 31 1
118...

result:

ok 

Test #96:

score: 20
Accepted
time: 5ms
memory: 17008kb

input:

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

output:

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

result:

ok 

Test #97:

score: 20
Accepted
time: 51ms
memory: 22664kb

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
2838 7942 185843 20229
7942 10149 185845 20229
2140 2838 185841 20229
5273 12043 185841 20233
9115 11351 185847 20231
2838 5273 185841 20231
9115 10149 185845 20231
6438 7560 185845 20233
7560 9115 185847 20233
7318 12043 185839 20233
4415 10126 18...

result:

ok 

Test #98:

score: 20
Accepted
time: 16ms
memory: 23896kb

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: 649ms
memory: 104100kb

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
12390 29270 3 1
41974 143875 5 3
12390 143875 3 3
60211 140693 7 5
41974 140693 5 5
28967 106552 9 7
28967 60211 7 7
95544 177696 11 9
106552 177696 9 9
61755 92144 13 11
61755 95544 11 11
99458 157970 15 13
92144 99458 13 13
24083 129504 17 15
24...

result:

ok 

Test #100:

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

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: 26ms
memory: 21344kb

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: 50ms
memory: 28708kb

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: 301ms
memory: 50492kb

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
17946 45353 110443 196283
15188 17946 110445 196283
1413 15188 110447 196285
1413 52154 110449 196283
15188 61629 110447 196283
15188 52657 110445 196285
11488 45353 110441 196285
37083 42842 110435 196287
2784 42842 110437 196289
273 2784 110439 1...

result:

ok 

Test #104:

score: 20
Accepted
time: 428ms
memory: 61684kb

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
66813 93388 153473 85517
39771 85583 153473 85521
30657 85583 153475 85519
1559 30657 153477 85519
66813 85583 153473 85519
14693 56983 153441 85521
14693 92330 153443 85521
50252 78223 153463 85521
31957 91622 153471 85523
63498 89022 153485 8552...

result:

ok 

Test #105:

score: 20
Accepted
time: 557ms
memory: 77788kb

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
81807 139849 182973 18495
63909 81807 182973 18497
44847 63909 182973 18499
87037 104105 182995 18499
133780 137924 182967 18501
2994 106159 182973 18501
2261 17351 183005 18501
2261 53899 183007 18501
17351 130148 183003 18501
30375 104105 182995...

result:

ok 

Test #106:

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

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
54879 140287 12601 151483
54879 138547 12603 151485
35532 83957 12583 151483
30120 54879 12603 151483
55676 145038 12589 151485
34745 145038 12591 151487
29832 34745 12593 151485
119959 143197 12607 151485
119959 161445 12609 151485
20142 54879 12...

result:

ok 

Test #107:

score: 20
Accepted
time: 847ms
memory: 101036kb

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
52924 146892 121259 78833
106086 180411 121271 78833
52032 180411 121273 78833
52924 69411 121257 78833
73994 131451 121247 78835
95271 136033 121273 78835
124402 136939 121315 78835
40198 146892 121259 78835
136033 180411 121271 78835
67581 19149...

result:

ok 

Subtask #5:

score: 20
Accepted

Test #108:

score: 20
Accepted
time: 922ms
memory: 136312kb

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
22196 199575 3 1
22196 134526 5 1
134526 176680 7 1
11463 176680 9 1
11463 113449 11 1
35651 113449 13 1
35651 148350 15 1
148350 175149 17 1
40283 175149 19 1
40283 69729 21 1
69729 105095 23 1
88198 105095 25 1
23621 88198 27 1
23621 169602 29 1...

result:

ok 

Test #109:

score: 20
Accepted
time: 847ms
memory: 135660kb

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
7382 175495 3 1
52567 175495 5 1
52567 170148 7 1
43156 170148 9 1
43156 158134 11 1
14037 158134 13 1
14037 145270 15 1
119592 145270 17 1
45988 119592 19 1
45988 127346 21 1
45404 127346 23 1
45404 175972 25 1
138844 175972 27 1
138844 167089 29...

result:

ok 

Test #110:

score: 20
Accepted
time: 668ms
memory: 102832kb

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
4192 90803 50001 5
4192 28382 50003 3
4192 19235 50001 3
20316 68608 49999 7
106767 126894 50005 5
28382 126894 50003 5
68608 90803 49999 5
7336 51172 49997 9
105938 185072 50007 7
7336 20316 49997 7
105938 106767 50005 7
26724 174526 49995 11
107...

result:

ok 

Test #111:

score: 20
Accepted
time: 805ms
memory: 111164kb

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
136374 153844 3 1
136374 141726 5 1
7950 141726 7 1
7950 32224 9 1
32196 32224 11 1
32196 77679 13 1
75584 77679 15 1
75584 171036 17 1
30697 171036 19 1
30697 70616 21 1
17616 70616 23 1
17616 136158 25 1
44971 136158 27 1
44971 125645 29 1
10872...

result:

ok 

Test #112:

score: 20
Accepted
time: 760ms
memory: 113040kb

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
82333 121472 3 1
72425 82333 5 1
42592 72425 7 1
42592 89229 9 1
28463 89229 11 1
28463 120118 13 1
120118 155333 15 1
37239 155333 17 1
37239 126841 19 1
61019 126841 21 1
61019 118385 23 1
36708 118385 25 1
36708 168629 27 1
40231 168629 29 1
40...

result:

ok 

Test #113:

score: 20
Accepted
time: 5ms
memory: 16908kb

input:

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

output:

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

result:

ok 

Test #114:

score: 20
Accepted
time: 104ms
memory: 28780kb

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
6726 8530 185247 20535
8530 25339 185249 20535
802 951 185245 20537
2488 30396 185251 20537
2488 25386 185253 20539
9581 25386 185255 20537
9581 29089 185257 20537
1822 8328 185265 20537
4075 25386 185253 20537
25339 30396 185249 20537
802 6726 185...

result:

ok 

Test #115:

score: 20
Accepted
time: 9ms
memory: 19896kb

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: 24ms
memory: 26696kb

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: 58ms
memory: 34212kb

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: 419ms
memory: 61008kb

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
23707 44004 21125 185455
25622 31169 21137 185457
23707 74451 21125 185457
63789 92409 21125 185461
36474 63789 21127 185459
26086 36474 21129 185459
63789 74451 21125 185459
965 26086 21131 185459
25622 71719 21135 185459
52642 63537 21135 185461
...

result:

ok 

Test #119:

score: 20
Accepted
time: 515ms
memory: 74328kb

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
1240 76241 143755 112525
111015 124683 143887 112527
63070 111015 143889 112527
1240 56851 143755 112527
63070 124141 143891 112527
74015 113817 143743 112529
9806 49708 143749 112529
49708 68145 143751 112531
67338 68145 143753 112529
67338 86103...

result:

ok 

Test #120:

score: 20
Accepted
time: 647ms
memory: 87076kb

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
94163 113445 115377 118597
94163 98175 115379 118597
59332 94163 115377 118599
21560 78213 115357 118601
21560 34563 115359 118601
34563 118084 115361 118601
12306 37887 115379 118601
37887 59332 115377 118601
111187 132417 115349 118603
111187 14...

result:

ok 

Test #121:

score: 20
Accepted
time: 808ms
memory: 98344kb

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
147091 147557 70573 45711
13269 147557 70573 45709
119234 171599 70569 45711
63892 119234 70571 45713
77763 171599 70567 45711
63892 147091 70571 45711
75475 119234 70569 45713
125098 139112 70543 45715
73342 140272 70565 45715
140272 154032 70567...

result:

ok 

Test #122:

score: 20
Accepted
time: 927ms
memory: 106652kb

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
74831 113001 121123 78889
74831 157398 121121 78889
74831 123640 121121 78891
135266 152282 121129 78891
41101 160360 121143 78891
27299 52907 121115 78893
27299 56789 121117 78893
56789 121791 121119 78895
118304 121791 121121 78893
126276 162044...

result:

ok 

Subtask #6:

score: 0
Wrong Answer

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Test #123:

score: 30
Accepted
time: 5ms
memory: 16684kb

input:

ba73dbf9c7d5e5202834d6a500541c
4
200000 4
199998 4
200000 2
199998 2

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
3
2 3 199999 1
0 1 199999 3
1 3 199997 3

result:

ok 

Test #124:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
200000 199998
199998 200000
200000 200000
199998 199998

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
3
0 3 199999 199997
1 2 199999 199999
1 3 199997 199999

result:

ok 

Test #125:

score: 30
Accepted
time: 785ms
memory: 100892kb

input:

ba73dbf9c7d5e5202834d6a500541c
200000
1784 1386
1176 1976
1038 1738
1194 1602
1436 1156
1164 1640
1514 1952
1132 1700
1114 1624
1370 1310
1030 1866
1728 1000
1024 1356
1618 1228
1406 1044
1598 1570
1376 1082
1620 1332
1646 1240
1410 1712
1086 1260
1412 1424
1286 1176
1202 1968
1146 1682
1042 1320
13...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199999
47397 94267 1001 999
10655 94267 1003 999
10655 114478 1005 999
114478 165128 1007 999
4932 165128 1009 999
4932 104518 1011 999
104518 131953 1013 999
94042 131953 1015 999
94042 120619 1017 999
120619 121663 1019 999
121663 190106 1021 999
17909...

result:

ok 

Test #126:

score: 30
Accepted
time: 677ms
memory: 104308kb

input:

ba73dbf9c7d5e5202834d6a500541c
199999
133028 133028
12766 12768
49712 49714
50476 50478
157374 157376
154876 154878
66250 66250
48328 48330
125746 125746
92842 92844
85072 85074
109020 109022
148662 148662
67198 67200
70744 70744
114648 114650
120180 120182
59180 59182
52256 52258
21052 21054
161110...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199998
26141 139298 3 3
26141 145824 1 3
142026 179704 5 5
139298 179704 3 5
81799 167800 7 7
81799 142026 5 7
110848 119584 9 9
110848 167800 7 9
18689 175688 11 11
119584 175688 9 11
112569 148950 13 13
18689 148950 11 13
47400 168053 15 15
47400 11256...

result:

ok 

Test #127:

score: 30
Accepted
time: 356ms
memory: 79652kb

input:

ba73dbf9c7d5e5202834d6a500541c
200000
49744 49746
101460 101462
17124 17124
17910 17910
102486 102486
71914 71912
1850 1850
37026 37024
27810 27808
12632 12632
10982 10980
67836 67834
38714 38714
62630 62628
123180 123180
112744 112742
14328 14330
111296 111294
83526 83528
116384 116384
12856 12854
...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199999
161435 170761 3 1
114545 154197 3 3
115840 154197 5 3
114545 161435 1 3
20637 193990 5 5
92406 193990 7 7
115840 193990 7 5
134369 158718 7 9
134369 187510 9 7
158718 193990 5 7
73186 142656 9 9
86431 142656 11 11
142656 187510 11 9
7419 169819 11...

result:

ok 

Test #128:

score: 30
Accepted
time: 343ms
memory: 78236kb

input:

ba73dbf9c7d5e5202834d6a500541c
200000
56882 56882
2378 2378
62118 62122
36338 36338
54862 54864
93436 93438
133122 133124
106102 106102
118556 118558
2636 2636
7390 7392
113600 113604
94568 94568
43882 43884
33832 33832
67966 67966
90366 90370
35250 35252
6928 6930
66074 66076
115376 115380
40916 40...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199999
61948 161824 3 3
9274 161824 1 3
62368 192577 3 5
59484 62368 5 7
61948 62368 5 5
69642 185114 5 9
102048 185114 7 7
62368 69642 3 7
13717 27939 7 9
27939 45680 9 11
27939 102048 9 9
103058 195300 9 13
103058 156917 11 11
27939 195300 7 11
68286 1...

result:

ok 

Test #129:

score: 30
Accepted
time: 685ms
memory: 100848kb

input:

ba73dbf9c7d5e5202834d6a500541c
200000
762 776
946 952
34556 34562
11442 11450
44116 44126
22460 22462
31376 31382
23242 23252
18882 18886
42244 42254
15200 15212
25358 25368
38298 38306
33196 33204
22150 22166
23124 23124
310 310
768 768
20476 20480
30626 30638
5470 5476
33568 33584
40172 40188
9252...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199999
94778 100583 3 3
94778 177078 1 3
77700 156422 3 5
64590 77700 5 7
77700 100583 5 5
59880 167911 3 7
59880 130256 5 9
108232 130256 7 7
156422 167911 1 7
120694 125822 3 9
81421 125822 5 11
60695 81421 7 9
60695 186050 9 11
60695 108232 9 9
3361 2...

result:

ok 

Test #130:

score: 30
Accepted
time: 697ms
memory: 101300kb

input:

ba73dbf9c7d5e5202834d6a500541c
200000
2516 2554
6574 6610
6594 6654
10484 10498
40 96
5018 5080
3176 3214
3422 3452
5060 5102
5994 6034
286 338
5338 5380
2350 2364
2920 2938
11836 11860
7448 7498
9148 9162
7196 7236
9086 9142
1948 1976
6456 6520
9524 9542
6940 6992
8124 8150
7306 7306
586 628
11544 ...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199999
1384 48476 3 3
48476 102706 1 3
38297 174691 3 5
174691 182223 5 7
1384 174691 5 5
46948 84406 3 7
47761 84406 5 9
34826 47761 7 7
38297 46948 1 7
46564 104919 3 9
46564 125892 5 11
25059 125892 7 9
25059 192282 9 11
25059 34826 9 9
140428 149957 ...

result:

ok 

Test #131:

score: 0
Wrong Answer
time: 162ms
memory: 34760kb

input:

ba73dbf9c7d5e5202834d6a500541c
46320
185612 20720
185550 21680
185562 20750
185420 20976
185368 20962
185500 21290
185682 20734
185364 21538
185456 21194
185398 21524
185436 21102
185832 20904
185478 21162
185476 21300
185564 20996
185556 21278
185876 20958
185404 20968
185480 21498
185874 20788
185...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
46319
23799 30580 185717 20645
36378 44506 185723 20645
44506 46080 185725 20645
1709 16077 185717 20647
1709 1868 185719 20647
1868 44715 185721 20649
16444 44715 185723 20647
16444 31145 185725 20647
16077 30580 185715 20647
36378 44715 185721 20647
32...

result:

wrong answer Tree (a[742], b[742]) = (-1, -1) is not adjacent to edge between u[742]=24259 @(185706, 20698) and v[742]=27464 @(185706, 20696)