QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#472506#3101. Event Hopping 2egypt_ioi2024_07#8 177ms80188kbC++232.0kb2024-07-11 16:49:372024-07-11 16:49:37

详细

Subtask #1:

score: 7
Accepted

Test #1:

score: 7
Accepted
time: 1ms
memory: 5652kb

input:

1 1
1 3

output:

1

result:

ok single line: '1'

Test #2:

score: 0
Accepted
time: 1ms
memory: 5656kb

input:

2 1
2 4
3 7

output:

1

result:

ok single line: '1'

Test #3:

score: 0
Accepted
time: 1ms
memory: 5652kb

input:

3 1
2 5
3 5
4 7

output:

1

result:

ok single line: '1'

Test #4:

score: 0
Accepted
time: 173ms
memory: 80188kb

input:

99999 93097
40044 40749
44538 45365
46530 47401
52845 53481
59519 60065
86226 87059
88353 88992
95665 96502
95669 96575
100446 100968
121870 122544
130836 131540
146294 147230
151177 151970
160381 161376
164174 165119
166582 167438
169062 169687
173200 173849
177329 178217
189213 189811
249372 25029...

output:

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

result:

ok 93097 lines

Test #5:

score: 0
Accepted
time: 151ms
memory: 78864kb

input:

99999 88403
2150 2736
19195 20022
27727 28620
35862 36457
60973 61718
80791 81690
86082 86984
106677 107346
108139 108915
110531 111303
115660 116605
122015 122980
123932 124908
134353 135199
134501 135222
155517 156054
159779 160302
160367 161281
160417 161149
164477 165443
176902 177695
188399 189...

output:

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

result:

ok 88403 lines

Test #6:

score: 0
Accepted
time: 166ms
memory: 78404kb

input:

99999 83610
13054 13952
35115 35859
40425 41389
47089 47725
59574 60420
70210 71056
73047 73747
78599 79251
84786 85465
96167 97165
118120 118862
122717 123442
139557 140446
140442 140948
167280 168099
172791 173512
175238 175890
179283 180010
188674 189600
192740 193434
197040 197739
206126 206742
...

output:

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

result:

ok 83610 lines

Test #7:

score: 0
Accepted
time: 161ms
memory: 79156kb

input:

99999 74350
13130 13773
26195 26982
41474 42296
50556 51176
52028 52952
61800 62451
64260 64787
77433 78243
79862 80477
104820 105424
119745 120717
124071 124902
137929 138510
155031 155946
156225 156935
156558 157403
186203 186953
190155 190856
202887 203601
219505 220031
224776 225447
225343 22601...

output:

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

result:

ok 74350 lines

Test #8:

score: 0
Accepted
time: 173ms
memory: 79596kb

input:

100000 93001
8963 9929
13535 14469
13715 14543
62424 63376
64988 65554
66126 66943
80525 81309
81865 82540
82113 82814
83753 84473
91289 91956
93976 94815
123004 123792
137032 137701
145506 146047
154391 155306
163907 164811
173352 174335
207897 208525
216768 217487
224290 225235
247075 247627
25288...

output:

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

result:

ok 93001 lines

Test #9:

score: 0
Accepted
time: 171ms
memory: 78220kb

input:

100000 88358
548 1465
4599 5115
17400 18217
20126 21091
24033 24624
31908 32485
35051 36014
36278 36911
52827 53811
58821 59329
64125 64906
96889 97505
112354 113069
123259 124017
134029 134704
144556 145471
170781 171364
186208 186898
187848 188781
188857 189400
207006 207911
221835 222742
229559 2...

output:

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

result:

ok 88358 lines

Test #10:

score: 0
Accepted
time: 171ms
memory: 78932kb

input:

100000 83736
6162 6948
47528 48088
51581 52406
54252 55179
59136 60123
74088 74789
85966 86478
97745 98486
105645 106507
109178 110065
119123 119948
131090 132059
134054 135027
158930 159457
161639 162627
162886 163459
171585 172115
173959 174537
189725 190461
192362 193084
206375 207310
215518 2162...

output:

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

result:

ok 83736 lines

Test #11:

score: 0
Accepted
time: 164ms
memory: 78148kb

input:

100000 74537
1240 2045
45619 46191
47541 48308
60964 61831
66245 67022
97465 98412
100671 101637
101356 101891
106041 106847
107695 108471
130232 130957
142492 143049
144495 145192
152230 152795
176811 177714
178845 179825
181023 181667
186532 187200
213378 214004
223268 224065
237222 238060
252278 ...

output:

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

result:

ok 74537 lines

Test #12:

score: 0
Accepted
time: 147ms
memory: 76236kb

input:

100000 57378
288 9909
3927 11152
20084 28964
30571 39126
38628 45300
41935 47457
48699 55269
55106 61254
77890 83130
85054 93921
88571 96480
91031 99813
93263 100777
101052 107389
123891 133202
136899 144986
166399 172157
172062 180451
175185 181470
178642 185679
186035 191294
193000 202232
210529 2...

output:

1
3
4
6
7
9
10
14
15
16
17
19
21
22
23
24
28
31
33
35
38
41
42
43
45
47
49
51
52
54
55
56
57
59
61
62
63
64
65
66
67
68
69
70
71
73
74
75
76
77
78
80
81
82
84
86
88
89
91
93
94
96
97
98
101
103
104
106
107
109
111
112
114
117
119
121
123
124
125
126
128
129
131
133
135
137
139
141
142
144
146
148
15...

result:

ok 57378 lines

Test #13:

score: 0
Accepted
time: 140ms
memory: 77532kb

input:

100000 54689
635 6242
13982 22182
22661 30718
24154 30227
30660 36548
33924 42990
44017 50030
60973 66351
64489 72778
102975 110314
109192 117764
115739 121380
118596 126708
132734 139073
137862 143602
140007 147771
145000 151039
153742 162901
154064 161969
155008 162999
161339 166755
164906 173628
...

output:

1
2
3
6
7
8
10
12
14
16
18
22
23
24
25
27
31
32
34
35
36
38
39
41
43
46
47
48
49
52
56
57
58
59
60
63
65
67
70
72
73
75
76
79
80
82
83
84
86
87
89
90
91
93
94
95
96
100
101
104
105
107
110
113
114
119
121
126
127
128
130
131
133
134
135
137
138
141
143
144
148
149
151
152
156
158
160
161
163
164
165...

result:

ok 54689 lines

Test #14:

score: 0
Accepted
time: 137ms
memory: 76740kb

input:

100000 51899
12721 22028
16145 23647
28093 34105
31291 36638
44047 52326
55488 64995
56157 62217
66418 71755
68687 74835
69342 74935
70374 78347
71160 78293
98866 104712
106829 115593
123303 132506
127977 136686
131387 140227
143951 153377
151420 158533
153814 159285
159241 169053
167504 175345
2280...

output:

1
3
5
6
8
13
14
15
18
20
22
23
24
25
28
29
31
32
35
38
40
41
44
46
48
50
51
54
56
59
62
64
66
68
70
73
75
76
78
80
81
82
84
87
88
90
91
92
95
97
100
103
104
105
107
109
110
111
113
114
116
117
118
120
121
122
123
124
125
128
130
131
132
135
138
140
141
143
146
148
149
151
155
157
159
160
161
162
164...

result:

ok 51899 lines

Test #15:

score: 0
Accepted
time: 140ms
memory: 76088kb

input:

100000 45970
2875 10006
6962 14904
8232 13847
39406 45823
40169 48870
65197 71238
65771 73553
70120 79190
93112 101501
120131 129654
138254 143706
140305 147707
152704 161454
157287 166457
165588 173813
176164 184901
179803 186708
186911 196877
203774 212710
208535 217456
227845 234554
229061 236126...

output:

1
4
6
9
10
11
13
15
16
18
19
21
23
27
28
29
30
31
32
34
37
39
41
42
43
44
45
47
49
50
52
53
54
56
57
59
61
64
65
68
69
71
74
75
76
78
79
80
82
84
85
86
87
88
90
93
94
96
98
101
103
106
108
111
113
114
116
118
119
120
122
123
124
126
127
128
131
133
137
139
141
144
147
149
150
151
152
155
157
159
160...

result:

ok 45970 lines

Test #16:

score: 0
Accepted
time: 128ms
memory: 73460kb

input:

100000 12813
1033 81070
12954 81500
13156 68815
35338 111064
35506 119065
45225 124391
59060 117337
82625 160515
87693 157948
93135 171962
98548 149280
98885 184397
119996 172867
121551 204333
130795 181820
151221 223534
163612 238764
191948 268094
192810 249321
201147 280094
209164 272596
217258 28...

output:

1
8
17
27
34
43
51
57
62
70
77
86
91
98
104
110
119
128
136
142
150
157
169
177
182
189
201
206
215
222
228
234
244
251
258
266
275
285
296
306
315
321
327
332
340
351
358
370
376
387
395
404
408
415
421
427
431
441
450
455
462
466
474
476
482
487
493
500
507
515
520
528
537
545
551
557
566
577
585
...

result:

ok 12813 lines

Test #17:

score: 0
Accepted
time: 110ms
memory: 74720kb

input:

100000 11486
9958 109537
10290 105884
11646 98237
13442 105194
15629 88293
20778 93420
21509 86475
34164 89416
42240 109910
57255 128711
57391 155451
64212 135574
75341 158468
89926 183847
109410 200713
115234 179765
122402 209776
128743 205641
141578 222667
147296 215047
150895 216677
152208 248228...

output:

1
16
24
29
39
46
57
69
76
89
96
106
114
122
127
133
142
149
159
174
182
187
195
204
214
223
236
242
253
257
267
276
283
289
292
296
306
312
321
332
334
344
352
364
371
386
395
404
409
421
433
443
447
456
462
467
471
479
496
505
511
513
519
534
540
547
559
565
568
573
586
593
595
606
613
617
620
630
...

result:

ok 11486 lines

Test #18:

score: 0
Accepted
time: 120ms
memory: 75160kb

input:

100000 10243
20686 118188
28362 109019
29665 112454
42086 128002
47854 100516
69351 143086
80462 141232
82765 148621
85924 148841
85970 159110
109511 188316
112760 167213
126746 181139
126751 189646
139340 226463
141613 229658
142113 236962
142337 217316
192209 270843
201105 257365
240041 328724
244...

output:

1
13
19
27
34
40
48
60
69
73
82
95
98
104
114
123
131
135
140
147
159
170
178
188
200
211
220
230
233
241
247
259
266
275
281
285
294
301
312
316
335
341
351
356
366
376
388
397
405
415
422
430
441
451
455
460
474
480
488
498
504
513
523
531
541
546
557
566
575
584
592
596
607
612
620
636
642
650
66...

result:

ok 10243 lines

Test #19:

score: 0
Accepted
time: 120ms
memory: 73068kb

input:

100000 1692
1761 562188
8018 654677
12329 961589
21217 810688
21850 726916
26301 994382
28685 582608
32421 747755
39099 581374
47897 912559
54394 659595
56476 675836
60014 1008714
72795 994742
75196 843153
88489 828045
90004 1024886
100124 781515
106686 734628
107999 959025
110160 1066569
122777 730...

output:

1
74
151
213
267
332
383
442
509
574
624
693
759
817
874
936
992
1048
1101
1158
1230
1267
1317
1380
1451
1502
1567
1631
1694
1743
1812
1881
1931
1988
2034
2109
2159
2202
2258
2312
2367
2418
2485
2538
2610
2670
2724
2776
2830
2889
2949
3005
3045
3086
3159
3214
3278
3338
3394
3433
3497
3554
3618
3676
...

result:

ok 1692 lines

Test #20:

score: 0
Accepted
time: 106ms
memory: 73100kb

input:

100000 1532
11110 578739
15827 900884
20209 693425
20787 1005821
30145 907459
30992 780446
34235 729985
79035 651546
85599 832995
113134 652298
121940 1100169
135680 828786
141312 898191
143767 931673
177769 805753
181414 924082
191854 795021
201070 701360
211465 826185
217164 1154581
223164 1222889...

output:

1
59
141
198
298
373
433
509
588
657
726
787
853
914
997
1097
1186
1250
1338
1405
1484
1568
1648
1725
1785
1858
1941
2022
2074
2169
2239
2316
2367
2422
2493
2547
2629
2726
2814
2870
2928
2990
3081
3184
3250
3323
3412
3471
3526
3583
3648
3743
3820
3885
3975
4067
4166
4235
4300
4397
4446
4508
4573
463...

result:

ok 1532 lines

Test #21:

score: 0
Accepted
time: 120ms
memory: 72928kb

input:

100000 1359
6234 861238
9126 603680
11750 603711
24871 794005
43119 653921
44111 990217
50268 968692
68132 986854
68579 797843
72248 721632
91367 827206
98456 693310
116298 822182
124847 960194
126999 1008775
131415 872868
135286 662199
150820 781868
183837 915832
184357 1161197
185711 1042124
18840...

output:

1
100
175
228
303
383
436
546
659
729
784
857
927
966
1059
1156
1267
1331
1403
1452
1519
1610
1698
1764
1843
1914
1992
2086
2168
2244
2315
2381
2480
2550
2646
2716
2802
2900
2951
3023
3115
3195
3277
3358
3431
3522
3608
3697
3774
3847
3955
4024
4113
4195
4269
4368
4424
4538
4584
4637
4705
4808
4884
4...

result:

ok 1359 lines

Test #22:

score: 0
Accepted
time: 118ms
memory: 74100kb

input:

100000 189
11871 5366857
12597 9358750
14009 5205039
18514 9736021
20792 7819695
23493 6457961
25878 9701971
30227 9271987
37129 6458756
43408 9430450
45981 5848267
50021 6061887
57665 6870713
60542 9297323
64683 8507199
67331 6852620
69935 6350577
73053 9746131
112740 7267403
116273 9213900
137641 ...

output:

1
572
1043
1541
2077
2591
3133
3715
4226
4768
5321
5909
6431
6993
7524
8000
8521
9038
9591
10111
10656
11186
11721
12267
12750
13309
13841
14438
15054
15576
16105
16697
17307
17855
18411
18942
19467
19991
20485
21025
21572
22101
22621
23131
23638
24197
24754
25237
25768
26307
26801
27319
27835
28421...

result:

ok 189 lines

Test #23:

score: 0
Accepted
time: 129ms
memory: 73232kb

input:

100000 170
15020 9542401
19499 9392647
19904 7646218
22983 6941656
32667 6484681
46653 6933539
56208 5473471
60717 6361757
81926 5641147
91980 8928336
94894 5631653
120394 6671365
130890 7917964
132476 5985347
137771 7575277
148174 6984429
177899 9467333
180823 8727173
181899 7786849
206091 6801597
...

output:

1
986
1611
2322
3025
3902
4717
5286
6049
6896
7642
8175
8859
9822
10414
11247
11759
12574
13439
14178
15164
15737
16360
17016
17831
18383
19410
19995
20645
21598
22138
22804
23458
24118
24749
25491
26304
26897
27614
28482
29458
30044
30564
31404
32199
32801
33679
34575
35103
36012
36490
37092
37619
...

result:

ok 170 lines

Test #24:

score: 0
Accepted
time: 122ms
memory: 74388kb

input:

100000 151
3579 9118430
9447 9032933
14340 7691467
22723 5499192
34606 9834536
47116 6238057
50317 8013445
61242 5447275
69720 7351131
71026 5525709
99210 8453046
99742 5998151
126894 7899026
137262 5299483
147751 7757492
158431 9076647
196594 8459875
208689 8979881
217587 6422716
219034 6165744
228...

output:

1
892
1416
2260
3051
3627
4384
4969
5918
6702
7693
8359
8962
9766
10319
10963
11875
12671
13555
14324
15214
15851
16476
17083
18059
19031
19657
20336
21334
22133
22699
23417
24281
25024
25984
26940
27587
28388
29396
30246
31009
31969
32500
33250
34152
34913
35611
36580
37230
37880
38504
39134
39749
...

result:

ok 151 lines

Test #25:

score: 0
Accepted
time: 146ms
memory: 73720kb

input:

100000 18
8109 56775703
11232 74757212
15872 74507021
30195 57394492
45875 70393643
47551 74279114
49350 98896516
51429 80228938
53821 74959851
81875 67009083
93968 90825457
98446 68959198
125292 76509949
126753 73919168
150175 91319742
151324 97878794
157896 52805171
162328 81425517
162635 61803343...

output:

1
6137
13176
20323
26077
31648
37228
42943
48628
54162
59974
65670
71447
77199
82887
88502
94300
99914

result:

ok 18 lines

Test #26:

score: 0
Accepted
time: 133ms
memory: 73000kb

input:

100000 17
5751 56778827
15135 63974156
15673 63824206
22694 78041150
43956 56138887
53848 75522379
79685 88688017
82640 58184217
88386 82120905
98588 63275168
98929 72529330
100002 52940837
126875 50480059
130623 81125021
145677 83657256
152240 69367414
168620 93644452
175295 69686460
180229 9877236...

output:

1
6418
17109
25909
31937
37723
43378
49116
54774
60467
66115
71675
77321
83212
88901
94442
99985

result:

ok 17 lines

Test #27:

score: 0
Accepted
time: 129ms
memory: 73244kb

input:

100000 15
3561 66111120
9802 93321355
10933 78907631
20110 70956938
34371 94948134
77905 57173394
83776 91987357
90064 93855771
90222 84732759
91345 64200241
94774 94219049
100059 96434167
105668 93971823
107556 69555569
112624 59052396
114267 81539543
119384 55088679
120482 63806436
153401 78359176...

output:

1
7272
16593
25490
35385
44485
50708
59374
65768
71282
76945
82646
88442
94040
99963

result:

ok 15 lines

Test #28:

score: 0
Accepted
time: 117ms
memory: 74384kb

input:

100000 92832
3904 4676
17152 18031
45308 45968
52035 53028
65993 66781
70630 71224
93527 94490
103809 104329
110889 111438
121174 122156
136806 137731
151126 151674
155381 155886
174217 175136
179951 180923
186771 187721
196450 197416
233337 233891
235748 236671
239022 240011
250329 251110
274824 27...

output:

-1

result:

ok single line: '-1'

Test #29:

score: 0
Accepted
time: 118ms
memory: 73196kb

input:

100000 57559
9811 19660
39039 45034
51646 58360
77780 86559
88545 94426
92332 99376
95958 102734
98170 107323
99186 108855
115004 123561
118333 125003
131494 139616
150582 156372
160367 168741
169108 176437
169730 178826
188042 195536
198497 207252
205598 212689
209988 215705
215270 222264
248660 25...

output:

-1

result:

ok single line: '-1'

Test #30:

score: 0
Accepted
time: 118ms
memory: 73192kb

input:

100000 12816
10705 81228
24794 112425
26012 94365
33798 115157
50355 120380
65359 161028
65530 132290
76244 158981
86155 166344
91749 145380
107269 170103
108577 191966
121561 177732
139959 220843
140635 222426
163553 241075
173063 232632
173144 271194
177165 239814
178297 233885
207355 285290
21101...

output:

-1

result:

ok single line: '-1'

Test #31:

score: 0
Accepted
time: 121ms
memory: 74196kb

input:

100000 1697
4905 859654
6037 963822
18599 881164
19144 720042
24799 889785
39319 770870
40326 1013932
40964 680543
41319 734642
52952 1046566
73626 746287
74034 697292
82999 830672
88378 594384
97312 600480
117186 1045625
117665 838820
131440 725034
133455 938219
143307 691741
160872 839582
172998 9...

output:

-1

result:

ok single line: '-1'

Test #32:

score: 0
Accepted
time: 109ms
memory: 74320kb

input:

100000 188
6538 5750489
35295 8856905
36949 9632685
56936 5192568
57114 9654737
61953 7613350
63339 7586928
85730 8146324
87048 5432388
92541 5822993
114576 8399838
120763 8890670
139789 6933072
143129 6489022
152417 9469113
153109 7432894
167187 5629094
167690 9087360
170065 5959807
177657 8158375
...

output:

-1

result:

ok single line: '-1'

Test #33:

score: 0
Accepted
time: 124ms
memory: 74104kb

input:

100000 19
11696 86394771
15030 83193673
21618 98424422
22595 77878508
22735 86392647
57110 94832421
60929 80830109
75471 89004994
79095 85788873
96996 87641109
114341 94738620
124516 54384823
135830 69674965
137162 52868775
149489 90413528
154708 59929605
158576 58522310
165944 55363464
199794 60460...

output:

-1

result:

ok single line: '-1'

Test #34:

score: 0
Accepted
time: 136ms
memory: 75996kb

input:

100000 34512
4001 10178
16727 26432
19853 28114
23766 32478
30904 38359
44152 52631
45308 50981
65993 72726
70035 76387
70630 80277
93527 101277
119889 125005
130174 135535
130809 140777
145806 153240
151126 157221
155381 162706
179951 187096
183217 192764
186771 195896
223450 230464
235748 242621
2...

output:

1
2
5
6
8
11
12
13
15
17
18
21
22
23
25
26
28
30
31
32
34
36
39
43
44
45
48
50
52
53
54
55
57
59
61
63
65
66
67
70
73
75
76
78
80
82
84
85
87
88
90
92
93
95
97
102
105
106
107
108
109
110
111
113
114
115
116
119
123
127
128
130
132
134
135
137
140
141
142
143
145
147
148
149
150
152
153
155
159
161
...

result:

ok 34512 lines

Test #35:

score: 0
Accepted
time: 121ms
memory: 74152kb

input:

100000 23024
9811 19660
39039 45034
51646 58360
77780 86559
88545 94426
92332 99376
95958 102734
98170 107323
99186 108855
115004 123561
118333 125003
131494 139616
150582 156372
160367 168741
169108 176437
169730 178826
188042 195536
198497 207252
205598 212689
209988 215705
215270 222264
248660 25...

output:

1
2
3
4
5
7
10
12
13
14
15
17
18
20
22
27
29
30
31
32
34
36
38
41
44
45
47
48
49
51
54
56
57
58
60
63
65
66
69
71
73
74
77
79
80
81
84
87
89
90
91
93
96
97
98
100
101
104
105
106
107
109
110
111
112
115
116
117
118
123
125
127
129
130
131
132
133
135
139
140
142
145
146
147
149
152
155
158
160
162
1...

result:

ok 23024 lines

Test #36:

score: 0
Accepted
time: 122ms
memory: 74196kb

input:

100000 11469
1749 9673
24794 33141
31015 39543
31561 39131
73553 80366
100042 107436
100746 107380
103683 109419
121616 129753
146270 153353
168277 174235
172338 179442
173056 178254
180700 190697
180878 186178
204655 214273
225196 234024
229485 238120
231513 239770
241919 250375
260338 265971
27329...

output:

1
2
5
6
9
10
11
14
16
17
20
21
22
23
24
25
26
27
29
30
34
36
38
40
41
42
43
44
45
47
48
52
54
57
60
61
64
65
68
70
72
74
75
78
79
80
81
82
84
85
86
87
91
92
94
96
97
98
101
103
105
106
107
112
114
116
119
121
123
124
125
127
129
132
133
134
135
137
139
143
144
145
147
148
149
151
152
153
154
155
156...

result:

ok 11469 lines

Test #37:

score: 0
Accepted
time: 146ms
memory: 76104kb

input:

100000 50000
3385 22602
15118 17374
25918 36726
25983 30341
38262 60763
50908 54723
71193 90454
77723 84223
96157 121101
97502 113730
124067 136828
131197 132858
144072 152682
149026 150819
153227 170907
158212 169128
175048 182925
180847 180992
189127 200462
192369 194079
207707 216404
207976 21429...

output:

1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
41
43
45
47
49
51
53
55
57
59
61
63
65
67
69
71
73
75
77
79
81
83
85
87
89
91
93
95
97
99
101
103
105
107
109
111
113
115
117
119
121
123
125
127
129
131
133
135
137
139
141
143
145
147
149
151
153
155
157
159
161
163
165
167
169
171
173
175
177...

result:

ok 50000 lines

Test #38:

score: 0
Accepted
time: 157ms
memory: 77288kb

input:

100000 48000
3919 19928
6894 19295
26011 37935
30149 32523
46359 60844
48369 53998
62841 82568
70617 76333
86782 99607
93507 96845
109927 118141
111357 111996
118198 124460
120365 122508
135217 147445
136431 138035
148529 177957
148704 152131
196706 205108
198880 203741
208372 229413
211287 216823
2...

output:

1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
41
43
45
47
49
51
53
55
57
59
61
63
65
67
69
71
73
75
77
79
81
83
85
87
89
91
93
95
97
99
101
103
105
107
109
111
113
115
117
119
121
123
125
127
129
131
133
135
137
139
141
143
145
147
149
151
153
155
157
159
161
163
165
167
169
171
173
175
177...

result:

ok 48000 lines

Test #39:

score: 0
Accepted
time: 148ms
memory: 75648kb

input:

100000 46000
7861 32751
22760 26494
39684 45851
40904 42267
51634 54991
51964 52209
56358 76070
67961 70798
77254 94033
78951 94032
98974 105914
99051 99360
110232 130179
120381 127849
132057 156356
133077 149316
160834 186236
161096 170777
198236 202006
201494 201958
204118 211402
207491 209514
214...

output:

1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
41
43
45
47
49
51
53
55
57
59
61
63
65
67
69
71
73
75
77
79
81
83
85
87
89
91
93
95
97
99
101
103
105
107
109
111
113
115
117
119
121
123
125
127
129
131
133
135
137
139
141
143
145
147
149
151
153
155
157
159
161
163
165
167
169
171
173
175
177...

result:

ok 46000 lines

Test #40:

score: 0
Accepted
time: 144ms
memory: 77360kb

input:

100000 44000
354 15072
5536 14710
19678 32180
24230 27035
35679 49748
39329 41843
55851 66113
57846 62517
70107 82556
78170 81316
93880 106334
94742 101602
111770 140322
116978 123594
148941 157393
151851 154147
162583 191208
175952 186995
193692 209083
197078 207122
216756 226820
220611 221173
2355...

output:

1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
41
43
45
47
49
51
53
55
57
59
61
63
65
67
69
71
73
75
77
79
81
83
85
87
89
91
93
95
97
99
101
103
105
107
109
111
113
115
117
119
121
123
125
127
129
131
133
135
137
139
141
143
145
147
149
151
153
155
157
159
161
163
165
167
169
171
173
175
177...

result:

ok 44000 lines

Test #41:

score: 0
Accepted
time: 150ms
memory: 76700kb

input:

100000 42000
134 25412
10249 13603
30598 45694
31946 40951
48198 63861
54201 57603
65107 91885
67263 75648
94096 106664
100707 102011
108972 123744
111181 123208
124630 135088
130963 133544
140847 153932
151528 153069
154469 165953
160640 160969
166427 183054
166990 173221
187899 206409
193568 19497...

output:

1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
41
43
45
47
49
51
53
55
57
59
61
63
65
67
69
71
73
75
77
79
81
83
85
87
89
91
93
95
97
99
101
103
105
107
109
111
113
115
117
119
121
123
125
127
129
131
133
135
137
139
141
143
145
147
149
151
153
155
157
159
161
163
165
167
169
171
173
175
177...

result:

ok 42000 lines

Test #42:

score: 0
Accepted
time: 116ms
memory: 70960kb

input:

100000 50000
1009 11588
3172 7775
19428 37428
22241 27726
51939 57615
53942 56298
58145 60885
58411 60432
61299 76501
63967 71739
85978 91923
87118 88018
94158 118616
97458 98978
118969 145953
134410 143683
156177 175586
158124 168302
177242 200968
184735 195759
201230 229057
204144 209556
231440 23...

output:

-1

result:

ok single line: '-1'

Test #43:

score: 0
Accepted
time: 142ms
memory: 76576kb

input:

100000 48000
8719 22716
12838 18758
25031 34662
27255 29644
36275 45579
37805 44405
46705 65627
48769 55749
67561 94228
69548 92389
96929 126085
102443 123805
141386 149872
142704 147965
152130 158469
155481 157837
163047 172760
164879 169722
175291 191106
176879 189992
191715 193629
193209 193221
1...

output:

1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
41
43
45
47
49
51
53
55
57
59
61
64
65
67
69
71
73
75
77
79
81
83
85
87
89
91
93
95
97
99
101
103
105
107
109
111
113
115
117
119
121
123
125
127
129
131
133
135
137
139
141
143
145
147
149
151
153
155
157
159
161
163
165
167
169
171
173
175
177...

result:

ok 48000 lines

Test #44:

score: 0
Accepted
time: 153ms
memory: 73864kb

input:

100000 46000
4460 18592
14940 15931
31036 48231
38312 46712
48549 56979
51101 52256
58530 73717
61786 65665
89578 93845
90505 92793
102521 112267
103610 110594
114127 132083
115095 116697
134272 141258
138519 138645
142837 147164
145006 145017
151170 153207
151299 151553
153410 165257
155394 155740
...

output:

1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
41
43
45
47
49
51
53
55
57
59
61
63
65
67
69
71
73
75
77
79
81
83
85
87
89
91
93
95
97
99
101
103
105
107
109
111
113
115
117
119
121
123
125
127
129
131
133
135
137
139
141
143
145
147
149
151
154
155
157
159
161
163
165
167
169
171
173
175
177...

result:

ok 46000 lines

Test #45:

score: 0
Accepted
time: 146ms
memory: 75620kb

input:

100000 44000
1047 5029
3626 4711
8739 32789
13236 27827
35097 53905
38010 43949
53954 64670
60471 63932
67978 92650
78404 82803
95080 106127
97178 101387
121249 146770
131414 145489
148027 367100172
152489 155554
166771 171189
170302 170389
173847 186597
178831 180847
191175 196111
193676 195691
212...

output:

1
3
5
7
9
11
13
16
17
19
21
23
25
27
29
31
33
35
37
39
41
43
45
47
49
51
53
55
57
59
61
63
65
67
69
71
73
75
77
79
81
83
85
87
89
91
93
95
97
99
101
103
105
107
109
111
113
115
117
119
121
123
125
127
129
131
133
135
137
139
141
143
145
147
149
151
153
155
157
159
161
163
165
167
169
171
173
175
177...

result:

ok 44000 lines

Test #46:

score: 0
Accepted
time: 126ms
memory: 75316kb

input:

100000 42000
1129 26113
5530 8666
37885 56441
40648 42782
56710 64141
60057 60371
66227 72683
67207 68536
73560 104493
81024 463266735
105434 122451
109036 110088
128545 141007
130926 132762
142010 152970
142381 149757
159141 165577
159602 161127
167019 181155
173282 176180
193158 227989
215594 2267...

output:

1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
41
43
45
47
49
51
53
55
57
59
61
63
65
67
69
71
73
75
77
79
81
83
85
87
89
91
93
95
97
99
101
103
105
107
109
111
113
115
117
119
121
123
125
127
129
131
133
135
137
139
141
143
145
147
149
151
153
155
157
159
161
163
165
167
169
171
173
175
177...

result:

ok 42000 lines

Subtask #2:

score: 1
Accepted

Test #47:

score: 1
Accepted
time: 1ms
memory: 5568kb

input:

1 1
134842099 137944073

output:

1

result:

ok single line: '1'

Test #48:

score: 0
Accepted
time: 0ms
memory: 5580kb

input:

2 2
4015595 884953730
519508315 726912949

output:

-1

result:

ok single line: '-1'

Test #49:

score: 0
Accepted
time: 0ms
memory: 5620kb

input:

3 2
551691302 800582045
14063803 52897269
153641504 567834643

output:

1
2

result:

ok 2 lines

Test #50:

score: 0
Accepted
time: 1ms
memory: 5600kb

input:

18 3
157893686 958635898
790021767 976682032
534783017 706987897
216566011 510148270
288661613 856715472
81126924 420966670
9734253 823219818
77427078 241270378
182953794 928971032
65710916 937359407
159217847 343023570
266169092 635952191
94867522 407392584
298640819 490028599
281580042 514089998
6...

output:

2
3
4

result:

ok 3 lines

Test #51:

score: 0
Accepted
time: 1ms
memory: 5872kb

input:

19 3
345121760 363569961
369142474 697961114
204455374 777512357
278051598 780834857
119744682 610142516
112692534 284271720
530820418 613805256
666599238 970772442
684066330 747151742
52464000 153949333
361766230 921325388
34600363 168745634
119418778 738281466
828841976 976561834
257913352 2579536...

output:

1
2
6

result:

ok 3 lines

Test #52:

score: 0
Accepted
time: 1ms
memory: 5664kb

input:

20 3
226617517 417144410
401110226 504506272
204308913 972565478
100780114 930332684
473716139 730386187
327436800 871728821
662616072 881801440
469971234 769277127
437331467 913865677
641546412 700063729
82089639 830256714
384651823 502387376
558881974 905373190
468189379 998408858
9103683 60217281...

output:

1
7
18

result:

ok 3 lines

Test #53:

score: 0
Accepted
time: 1ms
memory: 5640kb

input:

20 5
715591101 817706977
777008847 930020190
379125190 717746290
308826535 651449374
799848635 899870053
173402733 393191194
565584335 789226348
291163241 758381981
249473019 374801668
294956234 880404922
451362750 913870571
98855617 246302398
339866606 382702111
293058132 409201146
478015003 708631...

output:

1
9
12
15
19

result:

ok 5 lines

Test #54:

score: 0
Accepted
time: 0ms
memory: 5636kb

input:

20 4
95564966 475651640
544140915 921414489
36636943 545028649
269212181 518161723
368415853 600482753
416749483 825099524
704848425 946709199
145082659 465308089
751497619 765279722
452763328 557958381
643817392 876292284
353226095 933184330
466610247 590597228
29324927 65589713
155598093 306733984...

output:

5
7
14
15

result:

ok 4 lines

Test #55:

score: 0
Accepted
time: 1ms
memory: 5652kb

input:

20 2
341059917 968468550
619575412 657744605
362725213 784431788
79002877 857963719
636336680 943339572
282572479 300370019
213849085 706084423
315706132 851874320
740367416 998763448
113510482 521411850
198080835 487564765
29193064 86493364
488295690 701227663
351650597 899167999
437802529 73566590...

output:

1
6

result:

ok 2 lines

Test #56:

score: 0
Accepted
time: 1ms
memory: 5872kb

input:

20 1
827468447 879951302
735432164 759558988
269959865 944012171
67243577 84278317
805433568 936534843
171608293 591686301
112362102 822334845
410116008 619648090
306041507 327894522
360193096 488922828
417005225 834550228
872712520 873151446
472785468 800113380
39268216 894210474
600856133 91169444...

output:

1

result:

ok single line: '1'

Test #57:

score: 0
Accepted
time: 1ms
memory: 5856kb

input:

20 9
18246520 289037312
223590378 904221984
158468076 685664873
661343077 978347160
435186112 640627800
559466880 559927584
45242916 566596015
130290765 300200349
175183463 434730463
75064355 595211002
333621902 449961207
28044312 78011568
267319532 981800089
579543582 623250773
501315035 549454467
...

output:

-1

result:

ok single line: '-1'

Test #58:

score: 0
Accepted
time: 1ms
memory: 5796kb

input:

20 4
282915225 425599000
46844071 877724908
331562754 774194013
454952275 729482745
26829711 957331160
627282472 841455868
100114358 781547255
150014807 274089000
534690006 980470663
541821180 599376720
84150518 232318480
4457533 168338098
28542916 343576455
94961278 964757965
1021672 802156769
1412...

output:

1
6
8
10

result:

ok 4 lines

Test #59:

score: 0
Accepted
time: 1ms
memory: 5872kb

input:

20 3
568423024 732950395
30698730 953476873
240194350 760469817
571506747 960258324
142530756 898809811
502816961 572446466
63299466 595327108
441383100 954106794
401449920 893452390
131382436 615911903
103318462 704161744
17001604 744184311
355982562 921938859
277739118 448466769
852604059 87135217...

output:

1
14
15

result:

ok 3 lines

Test #60:

score: 0
Accepted
time: 1ms
memory: 5828kb

input:

20 4
729581552 843936903
595777889 662269624
434082235 904888330
189209392 706890360
122057607 566242764
12655119 862773552
253295242 267145374
514009091 646726110
699170128 892329802
139765740 798881549
465088674 483212263
438274771 843531949
551372681 969365825
370571050 441985295
369851925 695022...

output:

1
2
7
11

result:

ok 4 lines

Test #61:

score: 0
Accepted
time: 1ms
memory: 5528kb

input:

20 3
52680030 171567270
562416436 932178589
180457200 874534710
57962547 619926504
514034951 735903893
569357027 949556658
96546655 769067522
156273105 550639233
102800728 342367246
341675981 994824681
12457939 294153271
13450385 307425366
90257349 383467364
29966544 411684432
69951674 186314264
223...

output:

-1

result:

ok single line: '-1'

Test #62:

score: 0
Accepted
time: 1ms
memory: 5564kb

input:

20 9
18 22
2 5
28 31
21 25
25 27
3 6
36 39
22 26
8 12
27 31
27 29
32 36
14 18
16 20
22 26
10 14
17 21
13 17
15 19
37 40

output:

2
3
4
5
7
9
12
17
18

result:

ok 9 lines

Test #63:

score: 0
Accepted
time: 1ms
memory: 5864kb

input:

20 8
14 16
32 36
12 16
11 13
32 36
11 15
8 11
27 31
17 21
11 14
10 12
32 35
14 16
10 12
27 30
8 12
36 39
13 15
4 7
8 11

output:

1
2
4
7
8
9
17
19

result:

ok 8 lines

Test #64:

score: 0
Accepted
time: 1ms
memory: 5784kb

input:

20 5
8 10
16 20
14 17
26 30
26 29
16 20
8 12
7 9
21 25
31 34
16 20
14 18
22 24
26 29
12 16
6 9
7 9
26 30
17 21
27 30

output:

1
2
4
9
10

result:

ok 5 lines

Test #65:

score: 0
Accepted
time: 1ms
memory: 5652kb

input:

19 9
7 10
14 17
17 20
19 21
37 40
19 23
21 24
17 20
26 28
14 17
26 30
36 40
23 25
27 29
3 7
22 25
6 9
22 25
10 13

output:

-1

result:

ok single line: '-1'

Test #66:

score: 0
Accepted
time: 1ms
memory: 5640kb

input:

20 9
22 25
29 31
15 17
21 25
14 18
21 25
37 40
24 28
5 9
31 35
37 40
5 9
17 21
5 7
15 18
34 37
16 19
6 10
7 11
33 35

output:

-1

result:

ok single line: '-1'

Test #67:

score: 0
Accepted
time: 1ms
memory: 5644kb

input:

20 17
845269015 850357565
231570833 238492480
112075343 117449946
332830039 342056906
888759754 896832046
12792516 19353665
142051900 147667172
535996252 545054726
746039922 755668317
14144485 23611147
478226018 488214529
566689172 574405398
203948947 210298368
289137613 296782362
492823093 50197134...

output:

1
2
3
4
5
6
7
8
9
11
12
13
14
15
16
17
19

result:

ok 17 lines

Test #68:

score: 0
Accepted
time: 1ms
memory: 5832kb

input:

20 15
14188856 19236114
98742802 106752117
24269095 29763729
643363334 650430602
640667308 647978576
977081895 982348536
745449811 751115078
498241588 506936783
527053854 533674727
491394449 500443949
173465864 181340285
697167305 702838894
494029651 501636657
356910520 365788783
450134494 457312713...

output:

1
2
3
4
6
7
8
9
11
12
14
15
16
17
18

result:

ok 15 lines

Test #69:

score: 0
Accepted
time: 1ms
memory: 5800kb

input:

20 12
563046220 568800423
199343954 205146700
914428529 921389051
770854212 778944781
293251360 301031517
752099979 757638337
414657306 422232787
418601435 427149870
720794559 729165510
977858157 984913657
140764201 146705765
31266372 40564939
160980681 169658134
856117526 862237237
140519584 147162...

output:

1
2
3
4
5
6
7
9
10
11
12
13

result:

ok 12 lines

Test #70:

score: 0
Accepted
time: 1ms
memory: 5832kb

input:

20 17
889180138 897645327
738509954 745477991
528540397 538119158
378206912 383476822
79879358 86001857
98066197 103959366
640908142 649924188
524017315 531755079
979262559 988488803
789090356 797993258
782717536 789923836
267087164 272268465
28139018 33712559
379981686 387166408
400347925 406679332...

output:

-1

result:

ok single line: '-1'

Test #71:

score: 0
Accepted
time: 1ms
memory: 5640kb

input:

20 18
561486485 569818195
630359186 636475010
742947739 748730836
366786866 372238382
741166510 746356459
980930968 989331451
907461849 915230070
5726074 14451679
866818884 872405363
819511837 827958204
712517924 722136545
870083014 876845261
35270659 40840598
711697632 718619034
85840159 92347641
1...

output:

-1

result:

ok single line: '-1'

Test #72:

score: 0
Accepted
time: 1ms
memory: 5652kb

input:

20 20
58260057 75328425
75328425 93791372
93791372 93883091
93883091 152718294
152718294 186033899
186033899 207919883
207919883 270240750
270240750 288647403
288647403 357864905
357864905 381181754
381181754 386254557
386254557 432675450
432675450 446987413
446987413 451012965
451012965 492937493
4...

output:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

result:

ok 20 lines

Test #73:

score: 0
Accepted
time: 1ms
memory: 5572kb

input:

20 19
57471590 160037396
160037396 194076047
194076047 261241448
261241448 311172263
311172263 403739986
403739986 426302161
426302161 455690634
455690634 482534841
482534841 516724753
516724753 533199987
533199987 574790581
574790581 579061246
579061246 579834662
579834662 585842666
585842666 59903...

output:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

result:

ok 19 lines

Subtask #3:

score: 0
Runtime Error

Test #74:

score: 31
Accepted
time: 2ms
memory: 8696kb

input:

3000 57
226083340 261990234
392684356 462929590
468018811 841719892
495096853 606046097
196983814 256423598
331199122 967656486
802593662 931108452
74501453 679054962
294344294 752837262
295708332 547261648
265421699 652708933
272959087 727136240
165667761 846917534
61770748 157663302
608516043 8492...

output:

50
85
104
139
173
189
257
273
297
327
347
374
411
543
600
665
686
750
766
850
971
977
990
1040
1069
1074
1109
1183
1226
1231
1316
1440
1508
1597
1611
1670
1676
1774
1811
1822
1885
1968
2005
2103
2153
2271
2304
2416
2445
2562
2593
2608
2690
2798
2873
2884
2952

result:

ok 57 lines

Test #75:

score: 0
Accepted
time: 4ms
memory: 8512kb

input:

3000 52
515391161 611274809
241579177 794330740
10171859 421070901
191803444 462515964
789307312 942558211
168283015 749632607
741578406 748242944
727114778 888235899
285915154 538783207
740946890 927609854
511153062 526293212
202320202 315438522
60716314 641460650
4714115 322423665
680445730 761796...

output:

1
7
192
299
300
315
336
345
359
372
452
465
492
510
527
562
584
760
800
901
931
956
1075
1130
1170
1252
1281
1302
1363
1390
1427
1451
1474
1483
1555
1579
1635
1668
1788
1926
1971
2031
2052
2075
2121
2219
2226
2241
2421
2541
2682
2859

result:

ok 52 lines

Test #76:

score: -31
Runtime Error

input:

3000 50
164570698 977045956
184755663 365443392
603003602 688612912
69841518 845988325
124418966 495851703
92585079 221534905
66139125 492051425
11421559 470042732
353246878 519346251
394298743 656627500
91775697 487156113
216248411 680156936
102411138 118357679
310656407 421025471
226521211 7328919...

output:


result:


Subtask #4:

score: 0
Wrong Answer

Test #111:

score: 61
Accepted
time: 169ms
memory: 72768kb

input:

100000 361
136798318 785362988
255943758 535488232
175203444 266819907
766993466 893575347
67274251 589651108
662289594 883406317
830803801 849703610
729398668 798198453
202605534 677648797
66407931 925909114
174421361 601553812
522629146 701284080
136544340 295925673
299796891 499869765
736583725 8...

output:

42
102
185
215
660
950
1006
1623
1980
2396
2561
3016
3096
3729
3924
4119
4471
4619
4677
5229
5380
5400
5430
5681
5889
5901
5924
6013
6031
6043
6049
6316
6365
6483
6510
6575
7327
7492
7798
7833
7867
7954
7984
8089
8092
8237
8885
9212
9714
9971
10114
10190
10242
10260
10265
10321
10533
11184
11295
115...

result:

ok 361 lines

Test #112:

score: 0
Accepted
time: 177ms
memory: 74136kb

input:

100000 328
269692358 997698065
516351186 607170799
899165316 935984256
231654824 951113023
397634275 844276634
272944023 356674362
331036300 591789552
534270410 758375903
257707030 473980095
317825664 516882620
610579169 989404143
101902362 760414607
698174500 729348168
91656793 503436924
534091914 ...

output:

2
41
110
127
301
353
368
542
632
984
1394
1776
1932
2009
2051
2284
2584
2910
3083
3223
3445
3641
3715
4307
4467
4551
4602
4653
4900
5174
5601
5642
5748
5905
5910
6444
6547
7011
7070
7477
7713
7954
7965
8034
8066
8161
8235
8362
8527
8582
8807
8947
9051
9053
9329
9647
9689
9712
9807
9851
9916
10022
10...

result:

ok 328 lines

Test #113:

score: 0
Accepted
time: 169ms
memory: 73632kb

input:

100000 292
473961621 864888449
190522959 820646665
9492513 22301217
37064228 860062372
391795076 902791815
197180141 731578247
474804419 869235660
337420840 436563026
11453242 873644167
75360028 186126449
31699663 787244799
767030400 822993892
109557343 876905381
31823632 671368043
747618025 7999011...

output:

3
8
12
18
25
68
258
271
431
671
746
759
958
1130
1230
1847
2037
2193
2205
2448
2594
2746
3130
3188
3824
3896
4053
4208
4356
4551
4673
4790
4836
5178
5205
5231
5382
5565
5613
5814
5916
5980
6338
6440
6821
7045
7378
7553
7584
7615
7703
8766
8839
9191
9224
9749
9796
9800
9972
9988
10285
10296
10395
104...

result:

ok 292 lines

Test #114:

score: -61
Wrong Answer
time: 163ms
memory: 72936kb

input:

100000 146
175643977 458162947
122110004 727270078
24786112 260954842
378646915 422692851
377845733 473430752
468331006 663764144
327593225 737427150
115723835 155636492
269251393 797888967
389252318 897957255
294924161 560923471
178959541 409597437
220814553 509182863
77416516 651426679
447529688 6...

output:

1
6
8
27
42
99
139
282
593
638
1498
1954
2189
2288
4171
4305
4554
4856
4868
5213
5937
6482
6599
7492
7533
7702
7724
7835
7990
8151
8501
9545
10202
12938
13407
13837
14131
14484
15053
15176
15606
15895
16102
16185
16796
16976
17542
17882
18864
19357
19477
19478
20381
20680
20848
22319
24436
24583
253...

result:

wrong answer 34th lines differ - expected: '11614', found: '12938'