QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#621233#1142. Fountain ParksAndy_Lin55 270ms45272kbC++171.3kb2024-10-08 11:20:522024-10-08 11:20:53

Judging History

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

  • [2024-10-08 11:20:53]
  • 评测
  • 测评结果:55
  • 用时:270ms
  • 内存:45272kb
  • [2024-10-08 11:20:52]
  • 提交

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]);
}
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());
  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))continue;
      int xx=x+1,yy=y+1;
      if((xx/2+yy/2)&1)yy-=2;
      if(us[{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))continue;
      int xx=x+1,yy=y+1;
      if(!((xx/2+yy/2)&1))xx-=2;
      if(us[{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;
}

详细

Subtask #1:

score: 5
Accepted

Test #1:

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

input:

ba73dbf9c7d5e5202834d6a500541c
1
2 2

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
0

result:

ok 

Test #2:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 2
2 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
1
0 1 1 3

result:

ok 

Test #3:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 2
2 6

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #4:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 2
2 4
2 6

output:

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

result:

ok 

Test #5:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
2 2
2 4
2 6
2 8

output:

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

result:

ok 

Test #6:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 2
2 4
2 8

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #7:

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

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
2 2
2 4
2 6
2 10

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #9:

score: 5
Accepted
time: 107ms
memory: 24340kb

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

result:

ok 

Test #10:

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

input:

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

output:

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

result:

ok 

Test #11:

score: 5
Accepted
time: 48ms
memory: 14484kb

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

result:

ok 

Test #12:

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

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

result:

ok 

Test #13:

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

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

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

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

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

result:

ok 

Subtask #2:

score: 10
Accepted

Dependency #1:

100%
Accepted

Test #17:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
4 4
2 4
4 2
2 2

output:

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

result:

ok 

Test #18:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
4 4
2 6
2 4
4 6

output:

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

result:

ok 

Test #19:

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

input:

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

output:

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

result:

ok 

Test #20:

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

input:

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

output:

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

result:

ok 

Test #21:

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

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
2 200000
4 199998
2 199998
4 200000

output:

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

result:

ok 

Test #23:

score: 10
Accepted
time: 247ms
memory: 43716kb

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 3
87387 174493 1 3
136703 49998 3 7
136703 193595 1 7
28659 190796 3 11
28659 171330 1 11
126146 148362 3 15
126146 10708 1 15
158430 171669 3 19
158430 139479 1 19
48968 74066 3 23
48968 29851 1 23
160919 176988 3 27
160919 111808 ...

result:

ok 

Test #24:

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

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

result:

ok 

Test #25:

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

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
1021 880 3 185599
1021 745 1 185599
720 1035 3 185603
720 1155 1 185603
187 593 3 185607
187 819 1 185607
979 1069 3 185611
979 1148 1 185611
356 534 3 185615
356 351 1 185615
982 58 3 185619
982 845 1 185619
772 515 3 185623
772 189 1 185623
44 9 3...

result:

ok 

Test #26:

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

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

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

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 3
35158 33964 1 3
64060 56823 3 7
64060 3654 1 7
52126 58574 3 11
52126 4938 1 11
6988 7109 3 15
6988 62140 1 15
32239 9254 3 19
32239 39082 1 19
12710 53382 3 23
12710 12916 1 23
40911 53789 3 27
40911 47784 1 27
46905 3827 3 31
4690...

result:

ok 

Test #29:

score: 10
Accepted
time: 145ms
memory: 27952kb

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 3 80001
71671 46985 1 80003
46985 96497 3 80003
46985 89055 3 80005
89055 77792 3 80007
89055 79357 1 80007
71793 42544 3 80011
71793 57759 1 80011
20411 71136 3 80015
20411 31331 1 80015
108465 94011 3 80019
108465 710 1 80019
119147 8...

result:

ok 

Test #30:

score: 10
Accepted
time: 198ms
memory: 36380kb

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
140728 39354 3 40003
140728 159895 1 40003
116824 60919 3 40007
116824 26002 1 40007
10395 79174 3 40011
10395 104968 1 40011
22190 144168 3 40015
22190 22827 1 40015
14103 30845 3 40019
14103 95800 1 40019
96808 7466 3 40023
96808 65716 1 40023
1...

result:

ok 

Test #31:

score: 10
Accepted
time: 256ms
memory: 44364kb

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
49531 5266 3 3
49531 157693 1 3
51820 17023 3 7
51820 22149 1 7
90756 84790 3 11
90756 148747 1 11
109158 75269 3 15
109158 192499 1 15
123414 174968 3 19
123414 35684 1 19
113244 115868 3 23
113244 18156 1 23
88733 52697 3 27
88733 91156 1 27
154...

result:

ok 

Test #32:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
4 2
4 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
1
1
0 1 5 3

result:

ok 

Test #33:

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

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

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 2
4 4

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #36:

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

input:

ba73dbf9c7d5e5202834d6a500541c
2
2 4
4 2

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #37:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 2
2 4
4 2

output:

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

result:

ok 

Test #38:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 2
2 4
4 4

output:

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

result:

ok 

Test #39:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 2
4 2
4 4

output:

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

result:

ok 

Test #40:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 4
4 2
4 4

output:

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

result:

ok 

Test #41:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 4
4 2
4 6

output:

3kr2yac8xnf3ktgcoqviaw115df6rra7is6p5uix
OK
0

result:

ok 

Test #42:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
2 200000
2 199998
4 200000

output:

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

result:

ok 

Test #43:

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

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

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

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
82931 37166 3 62139
82931 72659 3 62141
72659 38445 1 62143
38445 19421 3 62143
38445 47840 3 62145
47840 6134 1 62147
6134 81597 3 62147
27351 9792 3 62151
89190 42406 3 62159
99528 12885 3 62163
99528 32305 3 62165
32305 34397 1 62167
34397 95403...

result:

ok 

Test #46:

score: 10
Accepted
time: 177ms
memory: 33156kb

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
59075 18304 1 3
18304 70440 3 3
6184 9398 3 7
92983 75692 3 15
106115 110228 3 19
106115 51449 1 19
51449 129446 3 21
129446 135395 3 23
57727 8562 3 27
110892 77596 3 31
142224 88218 3 35
142224 9276 1 35
9276 130865 3 37
130865 80199 1 39
80199 ...

result:

ok 

Test #47:

score: 10
Accepted
time: 167ms
memory: 32656kb

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
42574 8228 3 3
42574 55747 1 3
55747 96449 3 5
96449 77348 3 7
96449 120955 1 7
120955 109902 3 9
109902 91793 1 11
91793 112023 3 11
329 7123 3 15
60913 99850 3 19
62949 122955 3 23
62949 86278 3 25
86278 118586 1 27
118586 28978 3 29
28978 33757...

result:

ok 

Subtask #3:

score: 0
Wrong Answer

Dependency #2:

100%
Accepted

Test #48:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
6 2
4 2
6 4
4 4

output:

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

result:

ok 

Test #49:

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

input:

ba73dbf9c7d5e5202834d6a500541c
4
6 6
4 4
6 4
4 6

output:

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

result:

ok 

Test #50:

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

input:

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

output:

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

result:

ok 

Test #51:

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

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

result:

ok 

Test #52:

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

input:

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

output:

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

result:

ok 

Test #53:

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

input:

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

output:

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

result:

ok 

Test #54:

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

input:

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

output:

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

result:

ok 

Test #55:

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

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
180833 174784 3 3
180833 126224 1 3
83881 198084 3 7
83881 138308 1 7
113233 860 3 11
113233 79947 1 11
150235 126172 3 15
150235 39002 1 15
33628 93935 3 19
33628 40658 1 19
188337 68644 3 23
188337 123479 1 23
93771 179172 3 27
93771 15412 1 27
...

result:

ok 

Test #56:

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

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

result:

ok 

Test #57:

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

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
1328 880 3 185599
1328 1329 3 185601
1329 1342 3 185603
1329 720 1 185603
1155 26 3 185607
1155 1553 1 185607
819 1181 3 185611
819 979 1 185611
1148 1391 3 185615
1148 356 1 185615
1272 1712 3 185619
1272 1657 1 185619
845 994 3 185623
845 1371 1 1...

result:

ok 

Test #58:

score: 0
Wrong Answer
time: 5ms
memory: 4768kb

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
0

result:

wrong answer Solution announced impossible, but it is possible.

Subtask #4:

score: 20
Accepted

Test #82:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
200000 2
200000 4
199998 2

output:

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

result:

ok 

Test #83:

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

input:

ba73dbf9c7d5e5202834d6a500541c
3
200000 200000
200000 199998
199998 200000

output:

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

result:

ok 

Test #84:

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

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

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

result:

ok 

Test #86:

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

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 5
113948 165294 3 5
165294 18854 5 7
18854 23669 3 9
23669 63414 5 9
162590 96089 7 3
63414 8148 5 11
8148 152046 7 11
96089 34265 9 5
152046 52407 7 13
52407 54259 9 13
34265 56476 11 5
56476 120029 11 7
54259 190093 9 15
190093 1...

result:

ok 

Test #87:

score: 20
Accepted
time: 245ms
memory: 43348kb

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
19497 176578 5 99997
19497 165411 5 99999
178153 56430 7 99995
178153 176578 7 99997
109685 83292 9 99993
109685 56430 9 99995
189718 197976 9 100005
114285 115128 11 99991
114285 83292 11 99993
85709 195804 11 100003
85709 197976 9 100003
68721 1...

result:

ok 

Test #88:

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

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
155301 138877 3 3
155301 161777 1 3
161777 24402 3 5
24402 102888 1 7
102888 96890 3 9
96890 106150 1 11
106150 158515 3 13
158515 110720 1 15
110720 66862 3 17
66862 32035 1 19
32035 109939 3 21
109939 51174 1 23
51174 73734 3 25
73734 151701 1 2...

result:

ok 

Test #89:

score: 20
Accepted
time: 132ms
memory: 21172kb

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

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

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

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 3
82235 92072 1 3
92072 170898 3 5
170898 148297 1 7
148297 30450 3 9
30450 75977 1 11
75977 130177 3 13
130177 162765 1 15
162765 52031 3 17
52031 182901 1 19
182901 178195 3 21
178195 6571 1 23
6571 30001 3 25
30001 180738 1 27
18...

result:

ok 

Test #93:

score: 20
Accepted
time: 214ms
memory: 43248kb

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
9159 14492 3 5
14492 87730 1 7
87730 107996 3 9
107996 151938 1 11
151938 169744 3 13
169744 37232 1 15
37232 114619 3 17
114619 167643 1 19
167643 40911 3 21
40911 113729 1 23
113729 7648 3 25
7648 57689 1 27
57689 164568 3 29
164568 48652 1 31
4...

result:

ok 

Test #94:

score: 20
Accepted
time: 270ms
memory: 43288kb

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 3
13984 7105 1 3
7105 15977 3 5
15977 64149 3 7
15977 133243 1 7
133243 73913 3 9
73913 172031 3 11
73913 170983 1 11
170983 13104 3 13
13104 95579 3 15
13104 85628 1 15
85628 68379 3 17
68379 159223 3 19
68379 107524 1 19
107524 13...

result:

ok 

Test #95:

score: 20
Accepted
time: 259ms
memory: 43424kb

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
48613 24987 5 1
18612 179686 5 5
196666 15294 5 9
137461 40554 5 13
127456 190006 5 17
51037 191712 5 21
100423 191849 5 25
188937 27619 5 29
12073 133440 5 33
3188 186111 5 37
169905 149317 5 41
148327 20313 5 45
154262 92125 5 49
189312 84616 5 ...

result:

ok 

Test #96:

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

input:

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

output:

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

result:

ok 

Test #97:

score: 20
Accepted
time: 13ms
memory: 6160kb

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
12099 5507 185665 20385
5507 9854 185667 20383
5507 5891 185667 20385
5891 5604 185665 20387
5604 13299 185667 20387
9854 6150 185669 20385
13299 861 185669 20389
6150 4891 185671 20383
861 3035 185671 20387
4891 6585 185673 20385
3035 3394 185671 ...

result:

ok 

Test #98:

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

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

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

result:

ok 

Test #100:

score: 20
Accepted
time: 10ms
memory: 5364kb

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

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

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

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
66124 69890 109899 196747
15113 68604 109901 196741
69890 72368 109901 196749
68604 11258 109901 196743
11258 31719 109903 196745
31719 72368 109901 196747
72368 12635 109903 196747
72368 7432 109903 196749
7432 62675 109901 196751
62675 71198 1099...

result:

ok 

Test #104:

score: 20
Accepted
time: 136ms
memory: 25244kb

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
76369 12226 152901 86109
18326 12226 152903 86109
12226 54522 152903 86111
12226 102925 152901 86111
10167 99644 152903 86115
13401 12569 152905 86057
53121 30716 152905 86105
54522 32675 152905 86109
8706 99644 152905 86115
99644 43939 152905 861...

result:

ok 

Test #105:

score: 20
Accepted
time: 173ms
memory: 33036kb

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
98041 15407 182451 19119
135592 33105 182453 18849
135592 75527 182451 18849
99464 53535 182453 18861
15407 63042 182453 19119
63042 76024 182453 19121
50183 33105 182453 18847
33105 8938 182455 18847
39760 118536 182455 18853
118536 9587 182455 1...

result:

ok 

Test #106:

score: 20
Accepted
time: 219ms
memory: 37336kb

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
168488 114436 11967 152091
63443 63574 11967 152095
155174 1513 11969 152081
32639 124372 11967 152089
124372 114436 11969 152091
114436 147852 11969 152093
63574 24999 11969 152097
63574 116884 11967 152097
116884 112019 11969 152099
112019 13956...

result:

ok 

Test #107:

score: 20
Accepted
time: 255ms
memory: 43288kb

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
95181 150864 120523 79483
94481 26551 120525 79417
150864 155672 120523 79485
155672 133793 120525 79485
147623 193577 120525 79493
26551 10430 120527 79419
26551 42275 120525 79419
160527 158281 120527 79479
160527 37739 120527 79481
133793 40697...

result:

ok 

Subtask #5:

score: 20
Accepted

Test #108:

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

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
199575 22196 3 3
199575 112394 1 3
112394 150136 3 5
150136 127248 1 7
127248 13121 3 9
13121 11799 1 11
11799 23271 3 13
23271 18663 1 15
18663 40400 3 17
40400 111415 1 19
111415 196272 3 21
196272 50327 1 23
50327 23534 3 25
23534 184173 1 27
1...

result:

ok 

Test #109:

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

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 3
7382 173678 1 3
173678 98672 3 5
98672 152665 1 7
152665 196130 3 9
196130 117775 1 11
117775 182076 3 13
182076 16050 1 15
16050 147105 3 17
147105 44354 1 19
44354 188324 3 21
188324 115086 1 23
115086 170770 3 25
170770 42334 1 ...

result:

ok 

Test #110:

score: 20
Accepted
time: 270ms
memory: 43688kb

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
103320 32191 3 50003
91487 65959 5 50001
91487 32191 3 50001
32191 158182 5 50003
158182 47303 5 50005
33562 175173 7 49999
33562 65959 5 49999
47303 179075 7 50005
179075 15517 7 50007
97748 191442 9 49997
97748 175173 7 49997
15517 114506 9 5000...

result:

ok 

Test #111:

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

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
153844 136374 3 3
153844 183524 1 3
183524 167151 3 5
167151 107090 3 7
167151 142114 1 7
142114 88910 3 9
88910 189429 3 11
88910 145937 1 11
145937 143141 3 13
143141 155420 3 15
143141 12356 1 15
12356 140638 3 17
140638 195802 3 19
140638 9787...

result:

ok 

Test #112:

score: 20
Accepted
time: 212ms
memory: 38472kb

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
121472 82333 3 3
121472 62771 1 3
62771 114145 3 5
114145 140261 1 7
140261 44338 3 9
44338 12435 1 11
12435 59614 3 11
12435 24956 3 13
24956 28840 1 15
28840 42081 3 17
42081 118552 1 19
118552 173678 3 21
173678 1098 3 23
173678 82802 1 23
8280...

result:

ok 

Test #113:

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

input:

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

output:

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

result:

ok 

Test #114:

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

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
14787 21747 185077 20849
21747 5891 185077 20851
5891 16555 185079 20851
5891 20205 185079 20853
16555 14795 185081 20853
14795 26637 185083 20851
26637 25748 185085 20853
26637 24755 185083 20853
25748 27624 185087 20851
27624 22908 185089 20853
2...

result:

ok 

Test #115:

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

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

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

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

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
97902 22618 20641 185977
97902 11858 20641 185979
28788 76448 20643 185899
96608 71833 20643 185967
22618 16761 20643 185979
76448 71151 20645 185897
76448 46663 20645 185899
17964 41298 20645 185965
17964 71833 20643 185965
16761 66989 20645 18597...

result:

ok 

Test #119:

score: 20
Accepted
time: 160ms
memory: 28144kb

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
78022 6053 143221 113047
6053 111332 143219 113049
111332 50879 143221 113049
97154 14480 143221 113053
97154 3649 143221 113055
38470 114491 143223 113023
38470 23613 143221 113023
75154 51234 143223 113043
50879 72092 143223 113051
50879 119198 ...

result:

ok 

Test #120:

score: 20
Accepted
time: 198ms
memory: 33484kb

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
97122 8539 114753 119153
63199 92273 114755 119147
63199 107578 114755 119149
107578 102391 114753 119151
102391 138950 114755 119151
102391 8539 114755 119153
8539 121616 114753 119155
121616 138628 114755 119155
97075 119719 114755 119159
138628...

result:

ok 

Test #121:

score: 20
Accepted
time: 229ms
memory: 38556kb

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
122181 113082 69989 46345
67331 113082 69991 46345
113082 136421 69991 46347
113082 160255 69989 46347
136421 39856 69993 46345
121949 54480 69995 46343
121949 39856 69995 46345
39856 164624 69993 46347
164624 21359 69995 46347
152398 59145 69997 ...

result:

ok 

Test #122:

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

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
41518 106872 120569 79585
41518 183980 120569 79587
106872 136847 120571 79587
136847 47005 120573 79585
3409 68291 120573 79589
12096 13286 120575 79571
76701 9303 120575 79579
108339 47005 120575 79585
47005 151028 120575 79587
47005 957 120573 ...

result:

ok 

Subtask #6:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

0%