QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#621261#1142. Fountain ParksAndy_Lin100 ✓421ms45560kbC++171.4kb2024-10-08 11:41:462024-10-08 11:41:46

Judging History

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

  • [2024-10-08 11:41:46]
  • 评测
  • 测评结果:100
  • 用时:421ms
  • 内存:45560kb
  • [2024-10-08 11:41:46]
  • 提交

answer

#include"parks.h"
#include<map>
#include<algorithm>
using namespace std;
void build(vector<int> u, vector<int> v, vector<int> a, vector<int> b);
int fa[200001],n;
int get(int x){
  return fa[x]==x?x:fa[x]=get(fa[x]);
}
bool cmp(pair<int,int> x,pair<int,int> y){
  if(x.second!=y.second)return x.second>y.second;
  return x.first<y.first;
}
int construct_roads(std::vector<int> x, std::vector<int> y){
  n=x.size();
  map<pair<int,int>,int>mp,us;
  vector<pair<int,int> >v;
  vector<int>va,vb,vu,vv;
  for(int i=0;i<n;++i){
    fa[i]=i;
    mp[{x[i],y[i]}]=i;v.push_back({x[i],y[i]});
  }
  sort(v.begin(),v.end(),cmp);
  for(auto [x,y]:v){
    if(mp.count({x+2,y})){
      int u=mp[{x,y}],v=mp[{x+2,y}];
      if(get(u)!=get(v)){
        int xx=x+1,yy=y+1;
        if((xx/2+yy/2)&1)yy-=2;
        if(us.count({xx,yy}))continue;
        us[{xx,yy}]=1;
        va.push_back(u);vb.push_back(v);vu.push_back(xx);vv.push_back(yy);
        fa[get(u)]=get(v);
      }
    }
    if(mp.count({x,y-2})){
      int u=mp[{x,y}],v=mp[{x,y-2}];
      if(get(u)!=get(v)){
        int xx=x+1,yy=y-1;
        if(!((xx/2+yy/2)&1))xx-=2;
        if(us.count({xx,yy}))continue;
        us[{xx,yy}]=1;
        va.push_back(u);vb.push_back(v);vu.push_back(xx);vv.push_back(yy);
        fa[get(u)]=get(v);
      }
    }
  }
  bool flag=1;
  for(int i=1;i<n;++i)flag&=(get(0)==get(i));
  if(!flag)return 0;
  build(va,vb,vu,vv);
  return 1;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

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

input:

ba73dbf9c7d5e5202834d6a500541c
1
2 2

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
0

result:

ok 

Test #2:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 2
2 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
1
1 0 1 3

result:

ok 

Test #3:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 2
2 6

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #4:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 2
2 4
2 6

output:

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

result:

ok 

Test #5:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
2 2
2 4
2 6
2 8

output:

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

result:

ok 

Test #6:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 2
2 4
2 8

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #7:

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

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
2 2
2 4
2 6
2 10

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #9:

score: 5
Accepted
time: 111ms
memory: 23904kb

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
25622 7217 1 199999
7217 17464 3 199997
17464 87140 1 199995
87140 65725 3 199993
65725 52294 1 199991
52294 74289 3 199989
74289 64811 1 199987
64811 55280 3 199985
55280 6073 1 199983
6073 31177 3 199981
31177 32612 1 199979
32612 18618 3 199977
...

result:

ok 

Test #10:

score: 5
Accepted
time: 8ms
memory: 5248kb

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
9999 9998 3 23121
9998 9997 1 23119
9997 9996 3 23117
9996 9995 1 23115
9995 9994 3 23113
9994 9993 1 23111
9993 9992 3 23109
9992 9991 1 23107
9991 9990 3 23105
9990 9989 1 23103
9989 9988 3 23101
9988 9987 1 23099
9987 9986 3 23097
9986 9985 1 230...

result:

ok 

Test #11:

score: 5
Accepted
time: 54ms
memory: 14024kb

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
53890 53889 3 111345
53889 53888 1 111343
53888 53887 3 111341
53887 53886 1 111339
53886 53885 3 111337
53885 53884 1 111335
53884 53883 3 111333
53883 53882 1 111331
53882 53881 3 111329
53881 53880 1 111327
53880 53879 3 111325
53879 53878 1 111...

result:

ok 

Test #12:

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

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
14978 14977 3 34909
14977 14976 1 34907
14976 14975 3 34905
14975 14974 1 34903
14974 14973 3 34901
14973 14972 1 34899
14972 14971 3 34897
14971 14970 1 34895
14970 14969 3 34893
14969 14968 1 34891
14968 14967 3 34889
14967 14966 1 34887
14966 14...

result:

ok 

Test #13:

score: 5
Accepted
time: 36ms
memory: 10572kb

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: 1ms
memory: 3900kb

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

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: 110ms
memory: 23656kb

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
72682 40153 1 199999
40153 69239 3 199997
69239 43605 1 199995
43605 87197 3 199993
87197 73536 1 199991
73536 95361 3 199989
95361 44870 1 199987
44870 46436 3 199985
46436 29757 1 199983
29757 31039 3 199981
31039 94717 1 199979
94717 12140 3 199...

result:

ok 

Subtask #2:

score: 10
Accepted

Dependency #1:

100%
Accepted

Test #17:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
4 4
2 4
4 2
2 2

output:

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

result:

ok 

Test #18:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
4 4
2 6
2 4
4 6

output:

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

result:

ok 

Test #19:

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

input:

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

output:

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

result:

ok 

Test #20:

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

input:

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

output:

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

result:

ok 

Test #21:

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

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
2 200000
4 199998
2 199998
4 200000

output:

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

result:

ok 

Test #23:

score: 10
Accepted
time: 287ms
memory: 45560kb

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
55749 92420 3 199999
55749 61310 1 199999
92420 10847 5 199999
61310 191766 3 199997
191766 164540 3 199995
191766 109045 1 199995
164540 6202 5 199995
109045 192743 3 199993
192743 161253 3 199991
192743 156053 1 199991
161253 132064 5 199991
156...

result:

ok 

Test #24:

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

input:

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

output:

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

result:

ok 

Test #25:

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

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
395 882 3 186769
1070 882 3 186767
1070 434 1 186767
882 421 5 186767
434 1074 3 186765
1074 452 3 186763
1074 860 1 186763
452 19 5 186763
860 985 3 186761
985 935 3 186759
985 472 1 186759
935 675 5 186759
472 252 3 186757
252 309 3 186755
252 115...

result:

ok 

Test #26:

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

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: 3ms
memory: 4404kb

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: 98ms
memory: 20416kb

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
23703 65744 3 79999
23703 28808 1 79999
65744 30851 5 79999
28808 3617 3 79997
3617 1412 3 79995
3617 15488 1 79995
1412 78008 5 79995
15488 12499 3 79993
12499 51621 3 79991
12499 28757 1 79991
51621 75747 5 79991
28757 1762 3 79989
1762 42486 3 7...

result:

ok 

Test #29:

score: 10
Accepted
time: 164ms
memory: 27832kb

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
65345 119857 3 199999
65345 87732 1 199999
119857 87929 5 199999
87732 11848 3 199997
11848 44848 3 199995
11848 39331 1 199995
44848 73357 5 199995
39331 102074 3 199993
102074 96210 3 199991
102074 6960 1 199991
96210 41616 5 199991
6960 45590 3...

result:

ok 

Test #30:

score: 10
Accepted
time: 216ms
memory: 36668kb

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
109081 15439 3 199999
109081 1207 1 199999
15439 26248 5 199999
1207 131138 3 199997
131138 3061 3 199995
131138 6739 1 199995
3061 125889 5 199995
6739 56232 3 199993
56232 137487 3 199991
56232 11297 1 199991
137487 38015 5 199991
11297 76868 3 ...

result:

ok 

Test #31:

score: 10
Accepted
time: 285ms
memory: 45192kb

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
131127 196244 3 199999
131127 9598 1 199999
196244 56112 5 199999
9598 189572 3 199997
189572 191096 3 199995
189572 143911 1 199995
191096 153326 5 199995
143911 127258 3 199993
127258 26997 3 199991
127258 50538 1 199991
26997 74887 5 199991
505...

result:

ok 

Test #32:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
4 2
4 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
1
1 0 5 3

result:

ok 

Test #33:

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

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 4
4 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
1
0 1 3 3

result:

ok 

Test #35:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 2
4 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #36:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 4
4 2

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #37:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 2
2 4
4 2

output:

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

result:

ok 

Test #38:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 2
2 4
4 4

output:

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

result:

ok 

Test #39:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 2
4 2
4 4

output:

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

result:

ok 

Test #40:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 4
4 2
4 4

output:

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

result:

ok 

Test #41:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 4
4 2
4 6

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #42:

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

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: 2ms
memory: 4400kb

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

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: 99ms
memory: 24188kb

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
99062 9383 3 199999
99062 63988 1 199999
63988 71342 3 199997
71342 56734 3 199995
71342 86195 1 199995
86195 42265 3 199993
42265 97316 3 199991
42265 28687 1 199991
28687 99883 3 199989
99883 12827 1 199987
12827 95515 3 199987
12827 52802 3 1999...

result:

ok 

Test #46:

score: 10
Accepted
time: 176ms
memory: 33764kb

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
93856 127777 3 199999
93856 30085 1 199999
30085 21548 3 199997
21548 105325 3 199995
105325 101728 5 199995
101728 115675 3 199993
115675 33489 5 199991
41767 33489 3 199991
33489 88463 3 199989
88463 82495 5 199987
82495 33559 3 199985
136281 33...

result:

ok 

Test #47:

score: 10
Accepted
time: 186ms
memory: 33712kb

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
42443 92495 5 199999
115458 92495 3 199999
92495 134867 3 199997
134867 16312 5 199995
49605 16312 3 199995
16312 72984 3 199993
72984 117537 5 199991
577 117537 3 199991
577 12900 3 199989
12900 21073 1 199987
21073 76175 3 199987
21073 26848 3 1...

result:

ok 

Subtask #3:

score: 15
Accepted

Dependency #2:

100%
Accepted

Test #48:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
6 2
4 2
6 4
4 4

output:

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

result:

ok 

Test #49:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
6 6
4 4
6 4
4 6

output:

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

result:

ok 

Test #50:

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

input:

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

output:

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

result:

ok 

Test #51:

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

input:

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

output:

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

result:

ok 

Test #52:

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

input:

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

output:

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

result:

ok 

Test #53:

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

input:

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

output:

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

result:

ok 

Test #54:

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

input:

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

output:

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

result:

ok 

Test #55:

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

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
195596 54667 3 133331
195596 107748 1 133331
54667 146156 5 133333
54667 40267 5 133331
107748 89985 3 133329
40267 62846 5 133329
62846 53399 7 133329
89985 178553 3 133327
89985 66220 1 133327
178553 183751 5 133327
66220 71784 3 133325
183751 5...

result:

ok 

Test #56:

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

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

result:

ok 

Test #57:

score: 15
Accepted
time: 2ms
memory: 4364kb

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
882 421 3 186769
1591 421 3 186767
1591 1200 1 186767
421 837 5 186769
421 1324 5 186767
1200 860 3 186765
1324 927 5 186765
927 472 7 186765
860 19 3 186763
860 1361 1 186763
19 1532 5 186763
1361 1642 3 186761
1532 1454 5 186761
1454 1627 7 186761...

result:

ok 

Test #58:

score: 15
Accepted
time: 6ms
memory: 4724kb

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
5661 3372 3 92153
3372 2868 3 92151
3372 1950 1 92151
1950 2188 3 92149
2188 4542 3 92147
2188 3352 1 92147
4542 3208 5 92147
3352 1106 3 92145
3208 5022 5 92145
5022 4756 7 92145
1106 3356 3 92143
1106 1667 1 92143
3356 3785 5 92143
1667 4562 3 921...

result:

ok 

Test #59:

score: 15
Accepted
time: 10ms
memory: 5044kb

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: 139ms
memory: 23392kb

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
53893 73577 5 66673
73577 27637 5 66671
27637 4815 7 66669
61468 4815 5 66669
4815 30444 5 66667
30444 26465 7 66665
48497 15988 3 66663
15988 26465 5 66665
15988 23732 5 66663
23732 27332 5 66661
23732 28783 3 66661
27332 19871 7 66661
28783 84679...

result:

ok 

Test #61:

score: 15
Accepted
time: 189ms
memory: 32020kb

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
29365 69151 5 90003
36914 69151 3 90003
36914 56531 3 90001
56531 119099 3 89999
56531 42142 1 89999
42142 107139 3 89997
105902 130458 7 89997
107139 78106 3 89995
107139 33260 1 89995
78106 130458 5 89997
130458 119157 5 89995
33260 89552 3 8999...

result:

ok 

Test #62:

score: 15
Accepted
time: 240ms
memory: 37344kb

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
151805 22991 3 199295
151805 72810 1 199295
22991 5588 5 199295
72810 37804 3 199293
5588 18238 5 199293
18238 14256 7 199293
37804 134783 3 199291
37804 163584 1 199291
134783 147584 5 199291
163584 92929 3 199289
92929 35782 3 199287
92929 57940...

result:

ok 

Test #63:

score: 15
Accepted
time: 293ms
memory: 43636kb

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
84826 199677 3 176787
84826 82254 3 176785
82254 92632 3 176783
82254 19636 1 176783
92632 83779 5 176785
92632 163291 5 176783
19636 188395 3 176781
163291 130650 5 176781
130650 18954 7 176781
188395 62367 3 176779
188395 30796 1 176779
62367 11...

result:

ok 

Test #64:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 2
6 2

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #65:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 2
4 2
6 2

output:

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

result:

ok 

Test #66:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
2 4
4 2
4 6
6 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #67:

score: 15
Accepted
time: 269ms
memory: 44764kb

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
158653 112913 3 199999
158653 121675 1 199999
112913 171476 5 200001
171476 165610 5 199999
121675 183438 3 199997
165610 186497 7 199997
183438 106830 1 199995
186497 194806 5 199995
106830 22876 3 199993
194806 35232 7 199993
22876 38976 1 19999...

result:

ok 

Test #68:

score: 15
Accepted
time: 280ms
memory: 44356kb

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
107217 152295 1 199999
160685 183642 5 199999
152295 27771 3 199997
183642 123664 7 199997
27771 135767 1 199995
123664 31876 5 199995
135767 179898 3 199993
31876 104657 7 199993
179898 197316 1 199991
104657 37072 5 199991
197316 159637 3 199989...

result:

ok 

Test #69:

score: 15
Accepted
time: 276ms
memory: 44216kb

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
76361 16049 3 199999
76361 34767 1 199999
16049 34249 5 200001
34249 114138 5 199999
34767 117292 3 199997
114138 172707 7 199997
117292 154975 1 199995
172707 19069 5 199995
154975 190499 3 199993
19069 131030 7 199993
190499 171672 1 199991
1310...

result:

ok 

Test #70:

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

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

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: 125ms
memory: 23444kb

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
11213 71451 5 97351
71451 99609 7 97349
99609 24096 5 97347
97859 24096 5 97345
24096 31941 7 97345
12144 12585 1 97343
31941 14409 5 97343
12585 9222 3 97343
9222 14409 5 97341
9222 36138 3 97341
36138 39554 5 97339
53372 39554 3 97339
39554 32793...

result:

ok 

Test #73:

score: 15
Accepted
time: 184ms
memory: 34348kb

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
105768 133758 3 199999
133758 80562 5 200001
133758 108892 5 199999
108892 20349 3 199997
20349 59232 5 199997
20349 125139 5 199995
8807 125139 3 199995
125139 77439 3 199993
77439 125054 5 199993
125054 29677 5 199991
29677 51598 7 199989
13572 ...

result:

ok 

Test #74:

score: 15
Accepted
time: 265ms
memory: 43776kb

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
5340 98243 3 199999
5340 147417 1 199999
98243 107144 5 200001
107144 125780 5 199999
147417 135301 3 199997
135301 75665 3 199995
135301 31592 1 199995
31592 94497 3 199993
134306 154060 7 199993
94497 115842 1 199991
154060 64147 5 199991
115842...

result:

ok 

Test #75:

score: 15
Accepted
time: 277ms
memory: 44608kb

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
97911 7081 3 159999
97911 168261 3 159997
7081 39714 5 159997
39714 7118 7 159997
168261 129836 1 159995
7118 179742 5 159995
129836 85274 3 159995
129836 53706 3 159993
179742 101105 7 159993
53706 65595 1 159991
101105 62837 5 159991
65595 15761...

result:

ok 

Test #76:

score: 15
Accepted
time: 259ms
memory: 44572kb

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
90174 129958 3 199999
90174 159594 1 199999
129958 88897 5 200001
88897 137269 5 199999
159594 157565 3 199997
137269 198133 7 199997
157565 88314 1 199995
198133 139561 5 199995
88314 151529 3 199993
139561 94288 7 199993
151529 68372 1 199991
94...

result:

ok 

Test #77:

score: 15
Accepted
time: 4ms
memory: 4492kb

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: 8ms
memory: 4948kb

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: 119ms
memory: 24080kb

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
95284 22299 7 89773
40951 22299 5 89773
22299 2808 5 89771
2808 70241 7 89769
10906 70241 5 89769
10906 96142 5 89767
19048 96142 3 89767
96142 55848 3 89765
55848 82218 5 89765
82218 49746 5 89763
85054 46606 3 89761
49746 50081 7 89761
46606 4531...

result:

ok 

Test #80:

score: 15
Accepted
time: 188ms
memory: 34568kb

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
13694 136152 3 199999
136152 60453 5 200001
136152 19726 5 199999
19726 100679 3 199997
133061 100679 3 199995
100679 138877 5 199997
100679 84645 5 199995
84645 92024 3 199993
144786 92024 3 199991
144786 75612 1 199991
92024 81007 5 199993
81007...

result:

ok 

Test #81:

score: 15
Accepted
time: 261ms
memory: 44500kb

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
125850 144356 5 199885
144356 155356 5 199883
112914 11342 3 199881
155356 188658 7 199881
11342 196372 1 199879
188658 120871 5 199879
196372 123205 3 199879
196372 26615 3 199877
123205 120871 5 199877
120871 122364 7 199877
26615 96389 1 199875...

result:

ok 

Subtask #4:

score: 20
Accepted

Test #82:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
200000 2
200000 4
199998 2

output:

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

result:

ok 

Test #83:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
200000 200000
200000 199998
199998 200000

output:

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

result:

ok 

Test #84:

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

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: 256ms
memory: 44764kb

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
177170 42656 3 199999
42656 64976 5 199999
64976 70454 5 199997
70454 99626 7 199997
99626 722 7 199995
722 108551 9 199995
108551 76300 9 199993
76300 32478 11 199993
32478 81828 11 199991
81828 30605 13 199991
30605 162100 13 199989
162100 20136...

result:

ok 

Test #86:

score: 20
Accepted
time: 261ms
memory: 43784kb

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
9002 16636 99999 100003
9002 177279 99997 100003
165137 177279 99997 100001
165137 180881 99995 100001
57191 180881 99995 99999
57191 98806 99993 99999
17593 178669 100005 99999
181732 98806 99993 99997
181732 41095 99991 99997
77464 178669 100003...

result:

ok 

Test #87:

score: 20
Accepted
time: 251ms
memory: 43972kb

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
189718 197976 9 100005
197976 85709 9 100003
85709 195804 11 100003
195804 179399 11 100001
165411 19497 5 99999
179399 177597 13 100001
177597 26922 13 99999
19497 176578 5 99997
176578 178153 7 99997
26922 169166 15 99999
169166 39208 15 99997
1...

result:

ok 

Test #88:

score: 20
Accepted
time: 217ms
memory: 38308kb

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
145497 50326 3 39999
145497 23955 1 39999
50326 415 5 40001
415 41385 7 39999
41385 103084 9 40001
103084 83651 11 39999
83651 147814 13 40001
147814 34482 15 39999
34482 103209 17 40001
103209 3970 19 39999
3970 98931 21 40001
98931 10631 23 3999...

result:

ok 

Test #89:

score: 20
Accepted
time: 165ms
memory: 21192kb

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: 280ms
memory: 37224kb

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: 302ms
memory: 37036kb

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: 331ms
memory: 43568kb

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
172935 31246 3 997
148698 38101 7 997
9479 173059 11 997
186078 33300 15 997
133436 71191 19 997
135876 65503 23 997
828 187683 27 997
77288 25161 31 997
56251 72888 35 997
138638 56530 39 997
167139 29277 43 997
21379 64223 47 997
23083 137036 51...

result:

ok 

Test #93:

score: 20
Accepted
time: 321ms
memory: 43588kb

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
30161 133231 3 999
30161 22679 1 999
133231 192432 5 1001
192432 15877 7 999
192432 1246 5 999
15877 149048 9 1001
149048 63301 11 999
149048 160627 9 999
63301 26312 13 1001
26312 29514 15 999
26312 101620 13 999
29514 55138 17 1001
55138 183822 ...

result:

ok 

Test #94:

score: 20
Accepted
time: 307ms
memory: 43244kb

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
194373 117419 3 1599
194373 49278 3 1597
117419 169018 5 1597
169018 136482 7 1599
136482 74584 9 1597
74584 12972 11 1599
12972 75062 13 1597
75062 41507 15 1599
41507 65716 17 1597
65716 167648 19 1599
167648 109159 21 1597
109159 199705 23 1599...

result:

ok 

Test #95:

score: 20
Accepted
time: 321ms
memory: 43324kb

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
87857 48197 5 1597
48197 119601 7 1599
119601 16411 9 1597
16411 61554 11 1599
61554 7290 13 1597
7290 153194 15 1599
153194 7513 17 1597
7513 43026 19 1599
43026 69571 21 1597
69571 84189 23 1599
84189 128683 25 1597
128683 189529 27 1599
189529 ...

result:

ok 

Test #96:

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

input:

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

output:

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

result:

ok 

Test #97:

score: 20
Accepted
time: 19ms
memory: 6152kb

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
13883 2628 185967 21013
9684 1063 185961 21011
4212 2628 185967 21011
4212 41 185965 21011
2628 11568 185969 21013
11568 13022 185971 21011
13022 3834 185973 21011
1063 1391 185963 21011
1391 41 185965 21009
3834 2205 185971 21009
12633 2205 185971...

result:

ok 

Test #98:

score: 20
Accepted
time: 59ms
memory: 12100kb

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: 256ms
memory: 44352kb

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
109113 136471 200001 199999
46740 136471 199999 199999
46740 102864 199999 199997
73960 102864 199997 199997
73960 139855 199997 199995
78572 139855 199995 199995
78572 38265 199995 199993
15948 38265 199993 199993
15948 51474 199993 199991
140481...

result:

ok 

Test #100:

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

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: 61ms
memory: 11504kb

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: 133ms
memory: 19896kb

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: 122ms
memory: 19664kb

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
59658 72608 110441 197163
58567 16470 110445 197163
72608 47686 110443 197163
47686 16470 110445 197161
47686 14543 110443 197161
16470 8397 110447 197163
8397 53163 110449 197161
69504 24800 110433 197159
38670 21209 110441 197159
14543 4856 11044...

result:

ok 

Test #104:

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

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
90085 2264 153327 86525
103411 76097 153453 86525
103411 84922 153451 86525
27937 62227 153323 86523
62227 2264 153325 86525
2264 100745 153325 86523
21480 69456 153397 86523
21493 18291 153439 86523
21493 60815 153437 86523
18291 94621 153441 865...

result:

ok 

Test #105:

score: 20
Accepted
time: 237ms
memory: 32080kb

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
16349 38668 183111 19645
16955 79342 183103 19643
79342 69340 183105 19643
38668 100665 183109 19643
69340 124965 183103 19641
62812 100665 183109 19641
62812 54293 183107 19641
94081 32765 183081 19639
106013 122739 183095 19639
122739 100438 183...

result:

ok 

Test #106:

score: 20
Accepted
time: 308ms
memory: 37356kb

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
130103 166388 12591 152737
103335 60265 12607 152737
48896 13274 12585 152735
166388 17255 12591 152735
17255 124073 12593 152735
60265 141803 12609 152737
60265 28582 12609 152735
141803 11081 12611 152735
11081 154450 12613 152737
103411 16235 1...

result:

ok 

Test #107:

score: 20
Accepted
time: 371ms
memory: 43368kb

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
95408 130175 121147 80171
130175 192526 121147 80169
137270 152101 121159 80169
192526 190021 121149 80169
190021 20634 121149 80167
122238 152101 121157 80169
152101 47363 121157 80167
103018 47057 121169 80167
20634 148737 121151 80167
148737 63...

result:

ok 

Subtask #5:

score: 20
Accepted

Test #108:

score: 20
Accepted
time: 253ms
memory: 44504kb

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
45242 107138 3 100003
45242 144962 3 100001
107138 17743 5 100001
17743 119245 7 100003
119245 41351 9 100001
41351 98503 11 100003
98503 190138 13 100001
190138 185409 15 100003
185409 45100 17 100001
45100 109867 19 100003
109867 124566 21 10000...

result:

ok 

Test #109:

score: 20
Accepted
time: 254ms
memory: 43868kb

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
112203 107366 50003 100003
112203 161310 50003 100001
107366 132148 50005 100001
132148 120057 50007 100003
120057 106940 50009 100001
106940 192145 50011 100003
192145 49043 50013 100001
49043 198865 50015 100003
198865 28079 50017 100001
28079 1...

result:

ok 

Test #110:

score: 20
Accepted
time: 249ms
memory: 44484kb

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
19799 134531 50003 100001
193584 134531 50001 100001
193584 129544 50001 99999
134531 166713 50003 99999
166713 188613 50005 99999
83410 129544 49999 99999
83410 141932 49999 99997
188613 130582 50005 99997
130582 163569 50007 99997
28351 141932 4...

result:

ok 

Test #111:

score: 20
Accepted
time: 332ms
memory: 42728kb

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
34456 82141 3 1023
34456 55222 3 1021
82141 26014 5 1021
26014 55455 7 1023
26014 163237 7 1021
55455 101058 9 1021
101058 158825 11 1023
101058 140496 11 1021
158825 186292 13 1021
186292 149595 15 1023
186292 101935 15 1021
149595 9029 17 1021
9...

result:

ok 

Test #112:

score: 20
Accepted
time: 305ms
memory: 38392kb

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
22637 29951 3 1391
22637 78171 1 1391
29951 75193 5 1393
75193 149394 7 1391
149394 9393 9 1393
9393 22579 11 1391
22579 52779 13 1393
22579 121495 13 1391
52779 107494 15 1391
107494 73802 17 1393
73802 71870 19 1391
71870 90524 21 1393
90524 103...

result:

ok 

Test #113:

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

input:

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

output:

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

result:

ok 

Test #114:

score: 20
Accepted
time: 43ms
memory: 9568kb

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
14786 25685 186419 21665
25685 19578 186421 21663
8916 30633 186397 21661
8916 24597 186395 21661
30633 21741 186399 21663
21741 263 186399 21661
5123 20242 186417 21661
20242 19578 186419 21663
20242 18378 186419 21661
19578 11127 186421 21661
111...

result:

ok 

Test #115:

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

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: 91ms
memory: 15436kb

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: 172ms
memory: 23500kb

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: 151ms
memory: 23236kb

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
91787 23418 21143 186329
70542 21591 21141 186329
21591 23418 21143 186327
23418 36467 21145 186329
23418 77133 21145 186327
36467 47605 21147 186327
47605 67581 21149 186327
77133 55001 21143 186325
67581 25353 21147 186325
55001 1292 21145 186325...

result:

ok 

Test #119:

score: 20
Accepted
time: 200ms
memory: 27976kb

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
90161 108109 143769 113533
90161 27731 143769 113531
23434 34577 143719 113529
27731 40494 143767 113529
34577 120847 143721 113529
120847 18489 143721 113527
40494 44149 143769 113529
40494 95937 143769 113527
26105 76954 143773 113527
18489 8989...

result:

ok 

Test #120:

score: 20
Accepted
time: 263ms
memory: 33672kb

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
100323 13974 115233 119731
16216 66472 115237 119731
16477 129969 115207 119729
13974 8489 115235 119731
8489 66472 115237 119729
66472 134512 115239 119731
66472 37779 115239 119729
129969 75056 115205 119727
121702 44123 115221 119729
44123 5452...

result:

ok 

Test #121:

score: 20
Accepted
time: 310ms
memory: 38436kb

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
139165 5891 70597 46913
5891 125253 70599 46913
125253 139529 70599 46911
125253 17482 70597 46911
17482 7882 70599 46909
30928 130798 70595 46907
130798 7882 70597 46909
7882 139595 70597 46907
43920 133563 70591 46905
139595 139887 70599 46905
1...

result:

ok 

Test #122:

score: 20
Accepted
time: 371ms
memory: 43336kb

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
102923 38701 121177 80145
38701 145113 121179 80145
102326 85916 121173 80143
145113 122252 121179 80143
145113 36628 121177 80143
122252 32868 121181 80145
32868 147924 121183 80143
32868 131020 121181 80143
147924 81610 121185 80145
81610 183377...

result:

ok 

Subtask #6:

score: 30
Accepted

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
200000 4
199998 4
200000 2
199998 2

output:

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

result:

ok 

Test #124:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
200000 199998
199998 200000
200000 200000
199998 199998

output:

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

result:

ok 

Test #125:

score: 30
Accepted
time: 387ms
memory: 43312kb

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
29379 35908 1001 1997
29379 56740 999 1997
35908 185202 1003 1999
35908 69481 1003 1997
185202 117256 1005 1997
117256 64437 1007 1999
117256 162130 1007 1997
64437 178610 1009 1997
178610 34646 1011 1999
178610 119323 1011 1997
34646 115362 1013 ...

result:

ok 

Test #126:

score: 30
Accepted
time: 252ms
memory: 44144kb

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
88743 98080 199999 199999
88743 21602 199997 199999
42838 21602 199997 199997
42838 110092 199995 199997
53967 110092 199995 199995
53967 187413 199993 199995
51478 187413 199993 199993
51478 70534 199991 199993
166182 70534 199991 199991
166182 1...

result:

ok 

Test #127:

score: 30
Accepted
time: 266ms
memory: 43608kb

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
157096 126837 133333 133335
152688 126837 133333 133333
152688 129121 133331 133333
126837 170366 133335 133333
27645 129121 133331 133331
27645 196164 133329 133331
129121 169740 133333 133331
38362 196164 133329 133329
38362 43499 133327 133329
...

result:

ok 

Test #128:

score: 30
Accepted
time: 273ms
memory: 43640kb

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
149619 45350 133333 133337
149619 153760 133333 133335
23684 153760 133331 133335
23684 133281 133331 133333
153760 89520 133333 133333
32376 133281 133329 133333
32376 90820 133329 133331
133281 158862 133331 133331
206 90820 133327 133331
206 10...

result:

ok 

Test #129:

score: 30
Accepted
time: 300ms
memory: 43824kb

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
157001 190776 44439 44455
157001 4655 44439 44453
84302 4655 44437 44453
84302 73734 44437 44451
4655 96348 44439 44451
96348 87397 44441 44453
96348 112803 44441 44451
87397 166505 44443 44451
166505 144460 44445 44453
166505 27661 44445 44451
14...

result:

ok 

Test #130:

score: 30
Accepted
time: 322ms
memory: 43336kb

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
79782 11716 12091 12155
79782 64646 12091 12153
11716 131600 12093 12153
131600 88834 12095 12155
131600 184406 12095 12153
88834 97049 12097 12153
97049 148399 12099 12155
97049 110227 12099 12153
148399 72031 12101 12153
72031 141746 12103 12155...

result:

ok 

Test #131:

score: 30
Accepted
time: 76ms
memory: 12520kb

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
35238 32413 185523 21817
12585 32413 185523 21815
12585 34816 185521 21815
32413 3102 185525 21817
32413 22978 185525 21815
34816 10104 185523 21813
31030 17239 185527 21813
41240 10104 185521 21813
41240 35860 185521 21811
10104 24766 185523 21811...

result:

ok 

Test #132:

score: 30
Accepted
time: 35ms
memory: 8508kb

input:

ba73dbf9c7d5e5202834d6a500541c
30000
168222 178842
196512 119388
196710 119380
196584 119266
196678 119290
196636 119442
168294 178902
168184 178974
196676 119422
196642 119406
196548 119424
196716 119382
168192 178810
168262 178984
196578 119446
168180 178752
196560 119280
196680 119200
196672 1192...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #133:

score: 30
Accepted
time: 126ms
memory: 16708kb

input:

ba73dbf9c7d5e5202834d6a500541c
80000
159084 135416
13496 13072
13486 13166
18782 56512
13354 13212
159082 135362
18840 56492
47132 130562
176744 183884
159178 135436
92764 136338
13364 13036
13366 13264
159056 135350
159208 135266
159144 135244
47092 130608
18824 56520
18760 56550
18854 56624
47048 ...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #134:

score: 30
Accepted
time: 237ms
memory: 28928kb

input:

ba73dbf9c7d5e5202834d6a500541c
150000
64856 103928
3856 63474
53938 173456
190302 64294
190122 64436
143294 54146
55680 79216
195316 66574
4022 63368
64678 103974
194176 64466
55710 79036
100402 142382
53886 173402
100304 142426
3968 63386
64716 103966
190274 64354
64878 103970
100288 142422
188578 ...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #135:

score: 30
Accepted
time: 327ms
memory: 37028kb

input:

ba73dbf9c7d5e5202834d6a500541c
200000
191134 71824
170268 159138
13986 32208
129736 17632
92912 115602
32140 38738
23018 151608
159928 56914
53228 79446
191220 71798
170346 159194
170246 159168
170288 159096
170284 159170
14004 32116
191192 71776
170278 159244
22978 151538
10592 74986
13986 32228
27...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #136:

score: 30
Accepted
time: 183ms
memory: 23180kb

input:

ba73dbf9c7d5e5202834d6a500541c
100000
21316 185658
21202 185768
21094 185736
21068 185968
20982 185860
20902 185824
21184 185644
21168 186112
21416 185894
20936 185998
20978 185962
21092 186196
21076 186138
20798 185844
20974 185674
21072 185890
20912 186044
21024 186216
20934 185734
21200 185828
20...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
99999
51532 11774 21217 186275
34451 11774 21217 186273
34451 13080 21215 186273
11774 72190 21219 186275
11774 94627 21219 186273
72190 17996 21221 186273
17996 42317 21223 186275
17996 41860 21223 186273
42317 62420 21225 186273
62420 81976 21227 18627...

result:

ok 

Test #137:

score: 30
Accepted
time: 217ms
memory: 27304kb

input:

ba73dbf9c7d5e5202834d6a500541c
120000
85986 186370
85984 186246
85742 185750
85402 186098
85504 186178
85382 186322
85872 186064
85466 186362
85678 185970
85626 186254
85756 185976
85350 186206
85862 186246
85590 186386
85420 186008
86040 186024
85774 185734
85570 186390
85888 185974
86044 186124
85...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
119999
113358 33674 85633 186543
25096 95035 85639 186543
25096 118010 85637 186543
95035 6161 85641 186543
41770 35422 85653 186545
35422 68 85653 186543
33674 87900 85635 186543
33674 93940 85635 186541
87900 118010 85637 186541
118010 21947 85639 1865...

result:

ok 

Test #138:

score: 30
Accepted
time: 257ms
memory: 32132kb

input:

ba73dbf9c7d5e5202834d6a500541c
140000
183050 19024
182692 18788
182966 19488
182850 19288
183106 19328
183080 18904
182838 19004
182702 19236
183354 18966
182620 18964
183258 18944
183288 18802
183340 18944
183162 18792
182976 18946
182878 18788
183182 19452
182890 19114
183292 18898
183148 19122
18...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
139999
9305 110189 183021 19503
24601 110189 183021 19501
24601 20907 183019 19501
110189 31520 183023 19501
139513 126109 183027 19501
133765 74115 183045 19501
133765 98739 183043 19501
74115 134075 183047 19501
86591 44473 183053 19501
44473 89555 183...

result:

ok 

Test #139:

score: 30
Accepted
time: 302ms
memory: 35252kb

input:

ba73dbf9c7d5e5202834d6a500541c
160000
47518 19576
47460 18882
47484 19474
47860 19320
47908 19484
47336 19076
47574 19454
47524 19614
47542 19270
47506 18886
47582 18948
47774 19384
47288 19138
47842 19458
47958 19222
47808 19372
47298 18996
47542 19438
47964 19208
47640 19492
47964 19488
47512 1927...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
159999
56942 5557 47677 19751
5557 48986 47677 19749
5557 45792 47675 19749
48986 153928 47679 19751
48986 30220 47679 19749
131182 45792 47675 19747
131182 59702 47673 19747
45792 36159 47677 19747
30220 12000 47679 19747
12000 108208 47681 19749
12000 ...

result:

ok 

Test #140:

score: 30
Accepted
time: 374ms
memory: 39356kb

input:

ba73dbf9c7d5e5202834d6a500541c
180000
145130 52018
144664 52446
144878 52376
144676 51960
144996 51904
145142 52306
145252 51890
145184 51848
144832 51904
145110 51958
145006 51936
144724 52602
144558 52270
145118 52144
144748 52678
144866 52212
144492 52466
144562 52222
144436 52124
144892 51986
14...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
179999
35960 140114 144937 52727
62282 161396 144899 52727
161396 113003 144901 52725
161396 108640 144899 52725
113003 2108 144903 52727
113003 173913 144903 52725
104457 72760 144933 52725
104457 29532 144931 52725
72760 140114 144935 52727
173913 1578...

result:

ok 

Test #141:

score: 30
Accepted
time: 421ms
memory: 43284kb

input:

ba73dbf9c7d5e5202834d6a500541c
200000
121472 79456
121056 79800
120988 79700
120930 79566
120792 79618
120746 79366
121444 79282
121226 79812
120826 79760
121066 79046
120838 79206
121566 79462
121026 79834
120988 79354
121390 79512
121318 79358
120868 79560
121476 79700
121572 79384
120872 79682
12...

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
199999
72524 187696 121199 80043
72524 85882 121197 80043
187696 199178 121201 80043
199178 188239 121199 80041
188239 175367 121201 80041
188239 50239 121201 80039
175367 182126 121203 80039
57207 50239 121199 80039
57207 197254 121199 80037
50239 58578...

result:

ok