QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#284089#7682. Redundant Towersucup-team1376RE 1267ms63744kbC++176.3kb2023-12-16 08:30:492023-12-16 08:30:49

詳細信息

Test #1:

score: 100
Accepted
time: 11ms
memory: 53396kb

input:

5 3
3 2
4 1
5 4
1 3
2 5
6
1
6
0
3
0
1

output:

4
3
2
2
2
3

result:

ok 6 numbers

Test #2:

score: 0
Accepted
time: 59ms
memory: 53516kb

input:

20 2
13 9
7 15
10 6
15 12
12 11
14 18
18 19
6 4
2 16
3 10
1 8
4 14
8 3
9 17
19 1
11 13
16 2
20 5
17 20
5 7
100000
1
18
23
3
29
1
19
31
19
22
26
4
26
9
3
11
5
7
12
2
30
26
6
25
1
0
24
29
6
28
12
4
29
5
13
8
14
25
8
29
13
7
10
15
2
12
1
13
4
14
5
10
12
25
30
0
7
1
28
1
4
10
14
14
12
13
11
9
4
22
15
23...

output:

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

result:

ok 100000 numbers

Test #3:

score: 0
Accepted
time: 68ms
memory: 52808kb

input:

20 3
19 1
17 19
14 15
8 13
7 2
11 20
13 10
20 7
10 14
4 8
2 12
5 9
18 16
6 3
16 6
1 4
3 17
12 18
9 11
15 5
100000
1
19
1
22
0
3
2
29
21
23
24
7
21
11
11
31
1
11
30
7
10
15
15
4
7
30
1
10
2
4
13
9
31
12
8
12
24
1
11
4
1
11
7
8
26
26
9
27
4
0
8
21
28
24
13
7
12
0
4
13
14
1
10
5
13
0
3
11
10
0
28
13
10...

output:

18
19
18
18
19
18
19
18
17
16
15
16
15
15
15
14
13
14
15
14
14
13
12
13
12
11
12
11
11
12
13
12
11
12
13
12
11
10
11
10
9
10
9
8
9
10
9
8
7
6
7
8
9
8
9
8
7
8
9
10
9
8
7
8
7
6
7
6
7
8
7
8
7
6
5
6
7
8
9
8
7
8
9
8
9
8
9
9
10
11
10
9
8
8
9
10
9
8
9
8
9
8
9
10
9
10
11
12
11
10
11
10
11
10
9
10
11
10
9
10...

result:

ok 100000 numbers

Test #4:

score: 0
Accepted
time: 90ms
memory: 51112kb

input:

20 4
11 16
12 9
20 8
9 5
10 13
15 7
17 11
5 4
13 19
19 10
18 2
7 15
8 3
4 20
3 17
6 12
16 6
2 18
1 14
14 1
100000
1
15
7
10
2
31
4
2
3
2
31
1
24
7
9
28
1
30
13
26
24
7
15
12
15
3
14
30
8
6
13
10
22
10
24
25
5
0
15
1
12
24
26
15
13
0
13
1
5
25
24
0
5
14
25
5
24
14
11
10
27
14
13
12
2
13
25
29
10
2
3
...

output:

14
13
13
12
11
10
11
11
11
11
12
11
11
12
12
11
12
11
11
10
11
12
11
12
12
11
10
9
10
9
8
7
8
9
8
9
10
10
9
10
10
9
10
11
11
10
9
8
9
9
8
9
9
10
9
9
10
10
9
8
9
8
10
10
10
11
12
12
11
10
11
10
9
10
11
10
9
8
9
8
9
10
10
11
10
9
8
9
9
10
11
10
11
10
9
8
9
8
9
8
7
6
5
6
5
6
7
8
9
10
9
10
11
10
9
10
11...

result:

ok 100000 numbers

Test #5:

score: 0
Accepted
time: 90ms
memory: 53988kb

input:

20 5
1 20
20 15
16 9
5 2
10 18
9 10
17 5
7 12
14 4
12 16
8 11
18 14
6 3
19 8
15 7
2 6
3 13
13 19
4 1
11 17
100000
1
19
7
22
1
1
17
12
4
31
29
7
1
29
4
8
30
28
0
0
30
4
15
30
13
25
3
15
5
11
2
0
3
25
12
5
9
27
7
14
9
14
8
31
8
5
7
6
7
25
6
12
15
0
6
2
25
6
14
9
7
0
2
25
6
11
14
8
5
7
26
4
13
25
23
15...

output:

18
19
18
16
16
16
15
14
13
12
12
11
12
12
12
14
13
12
11
12
13
12
13
12
13
14
13
12
13
12
11
10
9
10
11
12
11
10
11
12
11
12
11
10
11
10
9
8
9
10
11
10
9
9
9
10
11
11
12
11
10
9
8
9
9
8
7
7
8
8
7
7
8
7
7
8
9
8
9
10
9
10
11
10
10
9
10
12
13
12
11
12
13
12
13
12
13
14
13
12
13
12
11
10
11
10
11
10
9
8...

result:

ok 100000 numbers

Test #6:

score: 0
Accepted
time: 167ms
memory: 53308kb

input:

50 2
29 14
34 42
4 15
7 8
16 5
19 31
3 32
44 50
22 35
39 26
1 16
2 29
5 48
40 21
35 2
8 18
14 22
38 17
21 13
37 44
48 23
12 19
46 43
28 34
9 38
10 37
49 25
42 41
23 3
50 4
43 1
24 40
6 36
17 46
47 20
31 7
27 24
41 9
25 10
13 47
18 33
32 6
20 27
11 12
26 28
36 30
33 39
15 11
30 49
45 45
100000
1
48
6...

output:

49
50
49
48
47
46
45
44
43
42
41
40
39
38
39
38
37
36
35
34
35
36
35
34
33
32
31
32
31
30
31
32
31
32
31
32
31
32
31
30
31
32
31
30
31
32
31
30
31
30
29
28
27
28
27
26
25
24
23
22
21
20
19
20
19
18
19
20
21
22
23
22
23
24
25
26
25
26
27
28
29
28
29
28
27
28
27
28
29
30
29
28
27
26
27
28
27
26
25
26
...

result:

ok 100000 numbers

Test #7:

score: 0
Accepted
time: 200ms
memory: 54148kb

input:

50 3
6 18
21 19
40 21
1 35
37 16
28 2
13 15
31 8
4 49
30 3
41 5
33 23
32 43
23 37
2 33
8 12
45 42
11 28
20 22
39 38
24 31
5 44
12 24
50 41
49 46
18 50
27 40
16 14
47 32
26 45
43 6
9 30
36 1
48 34
15 10
38 48
17 17
19 25
35 7
14 26
10 36
29 39
46 11
7 9
44 13
22 47
42 29
25 20
3 4
34 27
100000
1
48
5...

output:

49
50
49
48
47
46
45
44
43
42
41
40
39
38
37
36
35
34
33
32
31
32
31
30
29
28
29
28
27
26
27
28
29
30
29
30
29
28
29
30
29
28
29
28
27
28
27
26
27
26
27
28
29
30
29
30
29
28
27
28
29
30
31
32
31
32
33
32
31
30
31
32
33
32
33
32
31
30
29
28
27
28
29
30
31
32
31
32
33
32
31
30
29
30
29
28
27
28
27
26
...

result:

ok 100000 numbers

Test #8:

score: 0
Accepted
time: 237ms
memory: 54016kb

input:

50 4
49 43
41 49
10 19
45 22
11 23
8 37
35 40
29 18
1 20
48 10
13 30
47 25
26 8
22 26
12 5
15 15
6 11
18 33
9 45
46 28
28 29
14 12
31 3
32 48
33 47
39 32
40 44
2 41
17 9
30 7
19 14
37 50
42 17
16 13
7 6
5 46
21 36
38 16
27 35
34 21
43 42
20 31
25 24
36 38
4 2
24 4
23 1
3 39
44 27
50 34
100000
1
46
3...

output:

47
48
47
46
45
44
43
42
41
40
40
39
40
40
39
38
39
38
39
38
37
36
35
34
35
34
33
34
35
34
34
35
34
35
34
35
34
33
34
35
34
35
34
33
34
35
35
36
36
37
36
35
34
35
34
33
34
33
33
32
32
31
30
29
28
29
30
31
32
31
30
31
31
30
31
30
29
30
29
28
28
29
28
29
30
29
28
27
28
27
28
27
26
25
26
27
26
27
26
27
...

result:

ok 100000 numbers

Test #9:

score: 0
Accepted
time: 263ms
memory: 53552kb

input:

50 5
35 38
34 18
48 41
28 40
17 49
36 45
45 25
10 34
41 27
11 4
37 9
8 28
9 20
38 3
33 8
26 46
50 13
18 26
24 36
27 35
22 44
30 19
43 33
32 22
39 16
6 17
15 14
29 23
21 39
14 2
7 15
20 31
47 48
12 47
31 5
40 7
2 10
3 50
46 42
19 32
25 12
23 37
16 6
44 11
49 29
13 24
1 43
42 21
4 30
5 1
100000
1
42
5...

output:

43
44
43
42
42
40
39
40
39
39
38
38
37
37
36
35
34
35
35
35
34
35
34
33
33
32
33
32
31
30
30
29
28
27
26
24
23
22
23
24
24
23
24
25
24
25
26
28
27
28
27
28
27
26
25
26
27
26
27
28
29
29
28
27
27
28
27
28
28
29
28
27
28
27
26
25
26
25
26
27
27
28
29
28
27
26
26
27
28
29
28
27
28
27
26
27
28
29
28
27
...

result:

ok 100000 numbers

Test #10:

score: 0
Accepted
time: 303ms
memory: 53372kb

input:

1000 2
363 487
540 561
634 850
775 637
151 524
816 148
566 512
514 613
962 283
849 199
565 918
736 388
570 593
409 2
96 153
687 121
161 979
549 715
672 656
219 684
171 127
589 548
493 567
141 651
187 328
298 452
406 438
568 790
554 65
302 45
81 70
839 740
557 538
920 746
471 36
340 951
484 989
941 8...

output:

998
999
998
997
996
995
994
993
992
991
990
989
988
987
986
985
984
983
982
981
980
979
978
977
976
975
974
973
972
971
970
969
968
967
966
965
964
963
962
961
960
959
958
957
956
955
954
953
952
951
950
949
948
947
946
945
944
943
942
941
940
939
938
937
936
935
934
933
932
931
930
929
928
927
926
...

result:

ok 100000 numbers

Test #11:

score: 0
Accepted
time: 351ms
memory: 51084kb

input:

1000 3
517 150
194 215
148 477
212 14
174 203
861 91
673 370
784 563
418 869
479 416
154 815
409 873
768 699
357 969
220 990
923 578
333 376
472 598
803 141
434 942
961 310
22 536
636 133
59 767
250 993
58 489
354 828
260 31
838 549
71 443
102 791
494 723
127 348
864 750
110 819
165 190
382 864
537 ...

output:

999
1000
999
998
997
996
995
994
993
992
991
990
989
988
987
986
985
984
983
982
981
980
979
978
977
976
975
974
973
972
971
970
969
968
967
966
965
964
963
962
961
960
959
958
957
956
955
954
953
952
951
950
949
948
947
946
945
944
943
942
941
940
939
938
937
936
935
934
933
932
931
930
929
928
927...

result:

ok 100000 numbers

Test #12:

score: 0
Accepted
time: 396ms
memory: 53964kb

input:

1000 4
457 784
65 423
237 242
432 156
689 853
944 457
671 118
631 408
746 95
312 231
279 13
596 361
8 355
187 144
827 951
50 635
260 114
540 915
209 722
166 362
668 552
373 708
675 802
601 521
591 484
2 496
426 124
826 883
44 235
904 931
651 606
205 392
731 704
383 210
58 675
998 837
431 959
261 108...

output:

999
1000
999
998
997
996
995
994
993
992
991
990
989
988
987
986
985
984
983
982
981
980
979
978
977
976
975
974
973
972
971
970
969
970
969
968
967
966
965
964
963
962
961
960
959
958
957
956
955
954
953
952
951
950
949
948
947
946
945
944
943
942
941
940
939
938
937
936
935
934
933
932
931
930
929...

result:

ok 100000 numbers

Test #13:

score: 0
Accepted
time: 442ms
memory: 53148kb

input:

1000 5
824 740
70 49
569 650
658 101
621 410
968 515
762 861
18 598
681 553
163 916
994 72
507 450
972 205
975 936
572 428
264 717
609 104
599 226
564 623
415 439
814 204
802 127
329 52
562 679
557 262
179 719
403 113
804 41
558 631
847 386
983 880
214 958
243 531
202 81
649 301
149 203
727 710
44 2...

output:

997
998
997
996
995
994
993
992
991
990
989
988
987
986
985
984
983
982
981
980
979
978
977
976
975
974
973
972
971
970
969
968
967
966
965
966
965
964
963
962
961
960
959
958
957
956
955
954
953
952
951
950
949
948
947
946
945
944
945
944
943
942
943
942
941
940
939
938
937
936
937
936
935
934
933
...

result:

ok 100000 numbers

Test #14:

score: 0
Accepted
time: 799ms
memory: 60280kb

input:

100000 2
91296 50114
28944 8403
70352 98320
16429 29251
26200 13702
50779 35655
38633 52428
31032 38699
60664 37630
45533 30053
99857 36803
55392 50705
76406 88062
84487 52498
50872 77265
28942 85013
15654 10854
82071 14053
77888 85979
19240 98837
30632 45191
28143 6136
46776 58542
8008 78078
23122 ...

output:

99999
100000
99999
99998
99997
99996
99995
99994
99993
99992
99991
99990
99989
99988
99987
99986
99985
99984
99983
99982
99981
99980
99979
99978
99977
99976
99975
99974
99973
99972
99971
99970
99969
99968
99967
99966
99965
99964
99963
99962
99961
99960
99959
99958
99957
99956
99955
99954
99953
99952...

result:

ok 100000 numbers

Test #15:

score: 0
Accepted
time: 781ms
memory: 60108kb

input:

100000 2
40560 7110
65376 22740
79341 32718
8432 31878
32867 68436
51787 12631
53305 26133
73360 2964
93665 18883
60487 30092
63815 44811
42338 80369
13114 10887
62660 51217
99123 50052
35641 59216
82791 29814
55738 39348
7152 64607
74930 89533
38299 81094
2855 5163
42764 99905
34965 51842
82772 347...

output:

99999
100000
99999
99998
99997
99996
99995
99994
99993
99992
99991
99990
99989
99988
99987
99986
99985
99984
99983
99982
99981
99980
99979
99978
99977
99976
99975
99974
99973
99972
99971
99970
99969
99968
99967
99966
99965
99964
99963
99962
99961
99960
99959
99958
99957
99956
99955
99954
99953
99952...

result:

ok 100000 numbers

Test #16:

score: 0
Accepted
time: 881ms
memory: 58112kb

input:

100000 3
6413 65888
45012 67622
11794 6947
39451 78496
64989 90093
92404 55323
39346 13584
64808 28427
21872 41493
33788 67947
35928 16790
7984 58715
64503 78840
33040 36007
68881 32140
40439 31240
47878 89378
17674 79425
23552 93823
17861 67728
87146 68837
62962 74497
50615 11106
11006 91830
95877 ...

output:

99999
100000
99999
99998
99997
99996
99995
99994
99993
99992
99991
99990
99989
99988
99987
99986
99985
99984
99983
99982
99981
99980
99979
99978
99977
99978
99977
99976
99975
99974
99973
99972
99971
99970
99969
99968
99967
99966
99965
99964
99963
99962
99961
99960
99959
99958
99957
99956
99955
99954...

result:

ok 100000 numbers

Test #17:

score: 0
Accepted
time: 886ms
memory: 57124kb

input:

100000 3
25893 78634
73849 99870
37670 20958
62533 38840
71946 30495
82362 37584
89551 25312
90590 72229
5773 36576
30946 53042
94834 17820
23893 66515
52066 43325
24261 95063
88191 20001
92823 78683
3297 90692
49301 69272
81881 3306
78029 28796
55207 17177
45139 417
14576 12092
75757 31504
63979 53...

output:

99999
100000
99999
99998
99997
99996
99995
99994
99993
99992
99991
99990
99989
99988
99987
99986
99985
99984
99983
99982
99981
99980
99979
99978
99977
99976
99975
99974
99973
99972
99971
99970
99969
99968
99967
99966
99965
99964
99963
99962
99961
99960
99959
99958
99957
99956
99955
99954
99953
99952...

result:

ok 100000 numbers

Test #18:

score: 0
Accepted
time: 966ms
memory: 57304kb

input:

100000 4
46193 32830
41091 8689
52130 3939
99646 73315
8655 8774
19596 83824
71756 64126
76757 38981
72712 13228
97831 97977
39222 1464
20922 66822
80416 71024
99803 20310
74450 74062
76103 62964
41231 31085
12629 93669
71731 77085
15081 28041
84247 81861
96759 5288
43573 53886
55822 68307
19224 329...

output:

99999
100000
99999
99998
99997
99996
99995
99994
99993
99992
99991
99990
99989
99988
99987
99986
99985
99984
99983
99982
99981
99980
99979
99978
99977
99976
99975
99974
99973
99972
99971
99970
99969
99968
99967
99966
99965
99964
99963
99962
99961
99960
99959
99958
99957
99956
99955
99954
99953
99952...

result:

ok 100000 numbers

Test #19:

score: 0
Accepted
time: 948ms
memory: 57048kb

input:

100000 4
56720 21488
15848 55832
98829 25714
17970 17220
88325 19138
8069 74430
72674 26443
46604 31030
50344 89159
86334 72007
19619 7362
78205 92195
38714 43467
60573 239
69882 97307
61334 16976
87104 63944
82180 77836
95387 55348
57540 12388
33894 4720
79497 7034
85865 51109
68821 43934
16274 649...

output:

99999
100000
99999
99998
99997
99996
99995
99994
99993
99992
99991
99990
99989
99988
99987
99986
99985
99984
99983
99982
99981
99980
99979
99978
99977
99976
99975
99974
99973
99972
99971
99970
99969
99968
99967
99966
99965
99964
99963
99962
99961
99960
99959
99958
99957
99956
99955
99954
99953
99952...

result:

ok 100000 numbers

Test #20:

score: 0
Accepted
time: 1040ms
memory: 57404kb

input:

100000 5
39903 99245
69198 28614
43068 74408
35388 65387
31120 63757
30534 21462
39717 52278
53523 50480
41141 60787
6288 94932
47534 51766
99095 9557
21732 764
17977 65251
55016 34597
90213 73835
78451 10378
27097 79895
59286 80129
32662 45205
72629 85088
16469 35845
6332 18101
7711 49477
54366 100...

output:

99999
100000
99999
99998
99997
99996
99995
99994
99993
99992
99991
99990
99989
99988
99987
99986
99985
99984
99983
99982
99981
99980
99979
99978
99977
99976
99975
99974
99973
99972
99971
99970
99969
99968
99967
99966
99965
99964
99963
99962
99961
99960
99959
99958
99957
99956
99955
99954
99953
99952...

result:

ok 100000 numbers

Test #21:

score: 0
Accepted
time: 1061ms
memory: 55728kb

input:

100000 5
92019 92313
16973 82324
76369 55116
64732 34182
14323 80708
93011 71055
60182 75153
92332 39695
70950 97606
17074 18174
59762 8970
93858 2703
32266 4415
4366 21987
29646 74890
41 30074
5924 82342
37293 25026
15608 30837
46585 722
30348 67534
88022 48191
50771 29840
18359 99097
91855 39268
9...

output:

99999
100000
99999
99998
99997
99996
99995
99994
99993
99992
99991
99990
99989
99988
99987
99986
99985
99984
99983
99982
99981
99980
99979
99978
99977
99976
99975
99974
99973
99972
99971
99970
99969
99968
99967
99966
99965
99964
99963
99962
99961
99960
99959
99958
99957
99956
99955
99954
99953
99952...

result:

ok 100000 numbers

Test #22:

score: 0
Accepted
time: 993ms
memory: 63744kb

input:

100000 2
77207 77207
46937 46937
60884 60884
42545 42545
472 472
10482 10482
54456 54456
63273 63273
63043 63043
73838 73838
37406 37406
39547 39547
26775 26775
29142 29142
88552 88552
66160 66160
33850 33850
39204 39204
7858 7858
70586 70586
73602 73602
95289 95289
80494 80494
82084 82084
37359 373...

output:

4
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
32
34
36
38
40
42
44
46
48
50
52
54
56
58
60
62
64
66
68
70
72
74
76
78
80
82
84
86
88
90
92
94
96
98
100
102
104
106
108
110
112
114
116
118
120
122
124
126
128
130
132
134
136
138
140
142
144
146
148
150
152
154
156
158
160
162
164
166
168
170
172
174
176...

result:

ok 100000 numbers

Test #23:

score: 0
Accepted
time: 984ms
memory: 62156kb

input:

100000 2
11585 11585
70809 70809
60837 60837
26543 26543
70928 70928
8161 8161
90035 90035
94585 94585
40115 40115
74891 74891
95849 95849
16127 16127
61639 61639
61827 61827
81775 81775
30137 30137
83459 83459
16071 16071
65340 65340
47059 47059
73667 73667
29535 29535
63639 63639
54825 54825
14955...

output:

124
122
124
126
128
130
132
134
136
138
140
142
144
146
148
150
152
154
156
158
160
162
164
166
168
170
172
174
176
178
180
182
184
186
188
190
192
194
196
198
200
202
204
206
208
210
212
214
216
218
220
222
224
226
228
230
232
234
236
238
240
242
244
246
248
250
252
254
256
258
260
262
264
266
268
...

result:

ok 100000 numbers

Test #24:

score: 0
Accepted
time: 995ms
memory: 62200kb

input:

100000 2
31971 31971
52171 52171
23407 23407
12697 12697
27102 27102
7013 7013
79325 79325
72915 72915
37570 37570
45030 45030
31214 31214
73487 73487
65848 65848
42731 42731
14748 14748
96624 96624
38254 38254
34714 34714
26141 26141
9267 9267
38406 38406
49640 49640
50502 50502
94089 94089
96302 9...

output:

1196
1194
1196
1198
1200
1202
1204
1206
1208
1210
1212
1214
1216
1218
1220
1222
1224
1226
1228
1230
1232
1234
1236
1238
1240
1242
1244
1246
1246
1248
1250
1250
1252
1254
1256
1258
1260
1262
1264
1266
1268
1270
1272
1274
1276
1278
1280
1282
1284
1286
1288
1290
1292
1294
1296
1298
1300
1302
1304
1306
...

result:

ok 100000 numbers

Test #25:

score: 0
Accepted
time: 958ms
memory: 63292kb

input:

100000 2
64216 64216
48189 48189
48464 48464
28611 28611
51122 51122
2243 2243
18878 18878
32979 32979
28804 28804
28617 28617
47496 47496
92672 92672
71881 71881
14819 14819
67331 67331
52481 52481
61832 61832
67694 8248
83292 83292
85587 85587
55632 55632
41816 41816
25243 25243
74425 74425
81747 ...

output:

11299
11297
11299
11301
11303
11305
11307
11309
11308
11310
11312
11314
11316
11318
11317
11319
11321
11323
11324
11326
11328
11330
11332
11334
11336
11337
11339
11341
11343
11345
11346
11348
11347
11349
11350
11352
11354
11353
11354
11356
11358
11360
11362
11364
11366
11367
11369
11371
11373
11375
...

result:

ok 100000 numbers

Test #26:

score: 0
Accepted
time: 1267ms
memory: 60312kb

input:

100000 3
20317 95007
16826 16767
80427 79976
80647 80191
21059 72251
82421 81942
70218 69749
88429 87982
7962 7967
20859 20789
30591 80659
85567 18726
51980 51693
79065 78644
297 296
17487 17420
11041 68153
35083 35026
21258 21182
33670 33613
8475 8456
82963 82492
47419 37529
63245 10719
9614 72136
...

output:

33538
33539
33538
33540
33542
33541
33540
33542
33544
33546
33545
33547
33546
33548
33550
33549
33548
33547
33549
33551
33553
33552
33551
33553
33555
33557
33559
33558
33560
33562
33564
33563
33565
33567
33569
33571
33570
33572
33574
33573
33575
33574
33576
33578
33577
33579
33581
33580
33582
33584
...

result:

ok 100000 numbers

Test #27:

score: 0
Accepted
time: 1207ms
memory: 59992kb

input:

100000 3
69444 69074
61530 61298
40792 40603
11619 11501
57948 433
76548 76094
70488 11712
81619 44664
91904 91320
61968 61733
44773 44572
53614 53392
89479 88936
7517 7413
18421 18250
95920 13129
7006 69626
21613 21472
10709 10578
50324 50187
86961 48178
40146 39962
70310 64597
23052 22928
75161 82...

output:

33621
33619
33618
33617
33619
33621
33623
33625
33624
33626
33625
33624
33626
33628
33627
33629
33628
33630
33629
33631
33630
33629
33631
33633
33632
33634
33633
33635
33637
33636
33638
33640
33642
33641
33643
33645
33647
33646
33648
33650
33652
33654
33656
33655
33657
33659
33658
33657
33656
33655
...

result:

ok 100000 numbers

Test #28:

score: 0
Accepted
time: 1180ms
memory: 60220kb

input:

100000 3
13139 13017
2719 2638
92938 92194
56298 55787
4579 4480
66582 66020
35440 84499
96324 38062
9047 25072
61595 15340
77782 18312
28163 27996
42541 42178
79827 14149
33453 33167
13889 13779
8562 8417
71173 70576
85650 84935
34499 26459
53024 52557
42058 41725
47193 37856
13829 92542
93017 9226...

output:

41160
41158
41160
41162
41164
41166
41165
41164
41166
41168
41167
41169
41171
41173
41175
41177
41177
41179
41181
41183
41185
41184
41183
41185
41184
41186
41185
41187
41189
41188
41187
41189
41191
41193
41194
41196
41198
41199
41201
41203
41205
41207
41209
41208
41207
41209
41211
41210
41212
41211
...

result:

ok 100000 numbers

Test #29:

score: 0
Accepted
time: 1257ms
memory: 56900kb

input:

100000 5
60163 59847
34650 25470
30480 25469
13501 23993
60201 60648
63866 46172
40003 84583
44918 44635
20260 20160
40726 39091
47869 71308
52746 48299
6414 4733
73632 34745
79070 40509
12858 98305
88241 2161
76016 47237
50246 49905
5679 5656
50909 67788
85373 41205
64108 40765
87808 98165
2719 211...

output:

71494
71492
71491
71490
71489
71488
71490
71489
71488
71487
71486
71485
71484
71483
71482
71481
71480
71479
71481
71480
71479
71478
71477
71476
71475
71477
71476
71475
71474
71473
71472
71471
71473
71475
71474
71473
71472
71471
71470
71469
71468
71467
71469
71468
71467
71466
71468
71467
71466
71465
...

result:

ok 100000 numbers

Test #30:

score: 0
Accepted
time: 1255ms
memory: 57776kb

input:

100000 5
60823 60783
31890 76602
47922 72516
73749 58715
74657 74522
3224 3267
61128 61073
97122 19008
47 1053
67685 91215
61215 46895
97835 60270
36972 61653
89917 89712
42827 72692
8179 14885
21718 45021
17420 49132
60345 19598
77918 77771
95487 34627
52999 1392
18331 18372
52870 63575
37302 37376...

output:

71839
71837
71836
71838
71837
71836
71835
71834
71833
71832
71831
71830
71832
71834
71833
71832
71834
71836
71835
71834
71836
71835
71837
71836
71838
71837
71839
71838
71837
71836
71838
71837
71836
71838
71837
71839
71841
71840
71839
71838
71837
71839
71838
71837
71839
71838
71837
71839
71838
71840
...

result:

ok 100000 numbers

Test #31:

score: 0
Accepted
time: 1168ms
memory: 57976kb

input:

100000 5
85411 86413
97618 97173
44276 46904
84857 84503
53210 91707
19276 93732
82359 30468
66877 49469
28513 87724
628 71927
41285 11910
24667 11280
77010 69650
2112 45161
9005 9029
66397 86851
88468 90231
54288 12486
53616 92939
46329 17378
64699 67773
78267 28443
84142 83797
92465 17119
45945 90...

output:

91441
91442
91441
91440
91439
91438
91437
91438
91437
91437
91437
91436
91435
91434
91433
91432
91431
91430
91429
91428
91427
91426
91425
91424
91423
91422
91421
91420
91419
91418
91419
91418
91417
91416
91415
91417
91416
91415
91414
91413
91412
91411
91410
91409
91408
91407
91406
91405
91404
91403
...

result:

ok 100000 numbers

Test #32:

score: -100
Runtime Error

input:

99997 3
67590 82406
60530 89466
84847 34848
32213 17787
82185 32186
54727 4728
68597 18598
46130 96129
8918 58917
19050 69049
9723 40277
56193 6194
42181 7819
62914 87082
81459 31460
11831 38169
78712 71284
62543 12544
95391 45392
90958 59038
87783 37784
62557 12558
27920 77919
13365 36635
47351 264...

output:

2
0
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
32
34
36
38
40
42
44
46
48
50
52
54
56
58
60
62
64
66
68
70
72
74
76
78
80
82
84
86
88
90
92
94
96
98
100
102
104
106
108
110
112
114
116
118
120
122
124
126
128
130
132
134
136
138
140
142
144
146
148
150
152
154
156
158
160
162
164
166
168
170
172
174
1...

result: