QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#397266#5272. Greatest Common DivisorqiuzxAC ✓1924ms233272kbC++201.6kb2024-04-23 21:00:592024-04-23 21:01:01

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 7732kb

input:

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

output:

2 2
3 3
4 2
4 4
5 5
6 6
7 7
8 8
9 3
9 9
10 4
10 10
-1 -1

result:

ok 26 numbers

Test #2:

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

input:

1 1
1

output:

-1 -1

result:

ok 2 number(s): "-1 -1"

Test #3:

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

input:

5 100
2
20
17
14
23
19
8
10
21
19
16
16
19
16
6
11
9
12
5
12
21
8
15
5
24
5
5
17
6
12
1
21
25
3
20
8
7
11
15
8
6
1
16
25
14
1
11
13
11
20
6
2
5
7
3
6
19
20
3
22
21
11
13
18
18
14
2
1
19
3
20
23
3
16
1
8
14
16
11
9
10
17
22
3
8
12
2
12
9
5
18
6
9
25
6
12
19
14
16
6

output:

3 3
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
5 5
-1 -1
-1 -1
-1 -1
-1 -1
5 5
-1 -1
5 5
5 5
-1 -1
-1 -1
-1 -1
2 2
-1 -1
-1 -1
4 2
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
2 2
-1 -1
-1 -1
-1 -1
2 2
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
3 3
5 5
-1 -...

result:

ok 200 numbers

Test #4:

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

input:

20 100
289
374
235
204
189
215
84
194
242
331
216
326
264
113
181
344
124
91
39
189
256
77
228
155
201
52
386
31
384
397
267
282
226
249
400
208
48
176
131
296
288
266
75
367
298
311
388
165
11
121
44
269
325
293
392
210
365
150
221
365
188
298
23
192
223
179
245
286
103
118
314
352
394
255
78
225
4...

output:

-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
10 4
-1 -1
-...

result:

ok 200 numbers

Test #5:

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

input:

100 10000
6612
4694
4970
8529
7165
1355
9979
3049
2281
9998
5330
6674
5280
7838
729
810
5836
1465
5805
5812
5933
9493
7134
2581
3173
9673
2322
2776
3053
1377
9601
1547
1902
93
3114
5408
7577
8994
8173
189
6672
3431
2832
4764
6650
6842
379
7307
1283
7753
6203
1229
1849
297
9026
6520
9568
4419
5093
81...

output:

-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
57 57
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
...

result:

ok 20000 numbers

Test #6:

score: 0
Accepted
time: 72ms
memory: 4760kb

input:

1000 200000
134451
18536
303685
537674
428477
446829
583452
904095
295077
864453
949776
744108
144837
500318
596486
214710
338668
667766
679253
603928
158044
947810
272203
572606
767501
295561
508775
629483
950313
206695
394144
959539
932878
230667
676892
318913
642959
274136
662458
834771
792627
36...

output:

-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
...

result:

ok 400000 numbers

Test #7:

score: 0
Accepted
time: 190ms
memory: 14056kb

input:

10000 200000
2655653
24587357
25148377
40766601
43392625
53598135
20747785
35410107
39405761
58571003
50359654
79351089
20229583
11737455
91700105
75175779
26082486
26421724
51374385
2587276
15213302
69282831
73995969
38365995
37916148
97717081
11920317
64165764
28306295
40932112
94352977
55672605
1...

output:

-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
...

result:

ok 400000 numbers

Test #8:

score: 0
Accepted
time: 951ms
memory: 117408kb

input:

100000 200000
9900160421
1838711025
7215006831
4873988367
736988586
8927878267
9133829796
7556948229
1897988856
5049034409
4778625059
5483590472
2534396502
9316515227
4739195532
5161682788
8724411871
3977298661
9241212439
3737115542
1478991748
4568993297
2152062989
9851759441
1147444104
8871096091
8...

output:

-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
...

result:

ok 400000 numbers

Test #9:

score: 0
Accepted
time: 1817ms
memory: 233140kb

input:

200000 200000
32948377113
22059645181
23497311013
25253281510
39793515626
1865678358
9158656229
1778918552
13975436773
5477506324
21783129513
25651988491
34533469254
3463578976
37359343310
29676790297
14241253550
19999612518
36671331160
36450209763
14059416609
31447483418
24044362859
26764502859
273...

output:

-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
...

result:

ok 400000 numbers

Test #10:

score: 0
Accepted
time: 1924ms
memory: 233204kb

input:

200000 200000
453488
1327047
4092761
1555652
1046188
3417920
4128306
600779
933632
2042104
4346282
1557297
1684814
4267605
3777849
3193985
3303150
4077144
2870693
1264925
339502
3936334
1083004
3267043
798631
3594878
1464821
4362573
1118271
4077409
144642
2351321
2847425
4188482
290349
619421
374074...

output:

37264 464
79244 1030
187149 1782
88660 1114
67700 1048
164817 164817
188352 1911
45895 850
62478 933
109959 1269
195624 1959
88731 1092
94338 1174
193005 1848
176835 1925
157038 1665
160872 1521
186621 1857
145155 1431
76830 1224
30830 558
181948 24493
69420 1296
159600 1939
56373 915
170859 1644
84...

result:

ok 400000 numbers

Test #11:

score: 0
Accepted
time: 1921ms
memory: 233204kb

input:

200000 200000
2162017
2000771
2562858
4357230
3207545
3837453
750837
1776763
1603919
4070728
630246
3617341
2633197
4567901
692811
742381
4240322
4196086
3577938
2283913
3383967
4045060
3729297
120338
843387
2227255
192511
1318157
680495
3377417
2222392
4602498
4686587
341044
645308
2780544
3787647
...

output:

115428 1383
108108 1311
132924 748
195982 33790
157520 1464
178752 1647
53808 879
98247 1152
90762 1393
186405 1812
47310 819
171609 1677
135750 1389
-1 -1
50482 792
53315 930
192105 1941
190632 1417
170283 1695
121002 1353
163656 1976
185538 1893
175272 1683
14982 411
58475 965
118419 1341
20956 47...

result:

ok 400000 numbers

Test #12:

score: 0
Accepted
time: 1195ms
memory: 144152kb

input:

123123 200000
488120
1998022
1007841
329017
583503
957649
1441063
1816447
2760971
677595
2755128
1738916
2308592
2992517
1150488
386714
378018
1555377
2511342
2573204
2842029
1244935
2949447
1747085
2331902
2749169
2717523
33410
2005608
655774
2547238
63731
2905568
2717187
901432
2214374
2116417
161...

output:

39319 623
107985 1239
65865 1011
30210 584
45016 750
63540 858
83796 1208
99896 1202
-1 -1
49676 627
-1 -1
96664 1340
122116 1496
-1 -1
72306 72306
33554 622
33062 588
88647 1547
-1 -1
-1 -1
-1 -1
76049 76049
-1 -1
97008 1186
-1 -1
-1 -1
-1 -1
5844 236
108324 1221
48558 843
-1 -1
9612 414
-1 -1
-1 -...

result:

ok 400000 numbers

Test #13:

score: 0
Accepted
time: 1148ms
memory: 143524kb

input:

123123 200000
2132000
2132001
2132002
2132003
2132004
2132005
2132006
2132007
2132008
2132009
2132010
2132011
2132012
2132013
2132014
2132015
2132016
2132017
2132018
2132019
2132020
2132021
2132022
2132023
2132024
2132025
2132026
2132027
2132028
2132029
2132030
2132031
2132032
2132033
2132034
213203...

output:

114060 1518
114060 1656
114060 1668
114060 1692
114060 1704
114060 1845
114060 34218
114060 45624
114060 114060
114061 4342
114061 114061
114062 1729
114062 1755
114062 1781
114062 2173
114062 3034
114062 4922
114062 10660
114062 12519
114062 16692
114062 21935
114062 114062
114063 1254
114063 1257
...

result:

ok 400000 numbers

Test #14:

score: 0
Accepted
time: 94ms
memory: 6644kb

input:

1000 200000
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
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
...

output:

2 2
3 3
4 2
4 4
5 5
6 6
7 7
8 8
9 3
9 9
10 4
10 10
11 11
12 12
13 13
14 14
15 6
15 15
16 4
16 16
17 17
18 18
19 19
20 6
20 8
20 20
21 21
22 6
22 22
23 23
24 24
25 5
25 10
25 25
26 8
26 26
27 27
28 28
29 29
30 8
30 9
30 12
30 30
31 31
32 32
33 9
33 33
34 8
34 34
35 14
35 35
36 6
36 36
37 37
38 8
38 3...

result:

ok 400000 numbers

Test #15:

score: 0
Accepted
time: 88ms
memory: 6752kb

input:

3000 200000
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
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
...

output:

2 2
3 3
4 2
4 4
5 5
6 6
7 7
8 8
9 3
9 9
10 4
10 10
11 11
12 12
13 13
14 14
15 6
15 15
16 4
16 16
17 17
18 18
19 19
20 6
20 8
20 20
21 21
22 6
22 22
23 23
24 24
25 5
25 10
25 25
26 8
26 26
27 27
28 28
29 29
30 8
30 9
30 12
30 30
31 31
32 32
33 9
33 33
34 8
34 34
35 14
35 35
36 6
36 36
37 37
38 8
38 3...

result:

ok 400000 numbers

Test #16:

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

input:

5000 200000
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
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
...

output:

2 2
3 3
4 2
4 4
5 5
6 6
7 7
8 8
9 3
9 9
10 4
10 10
11 11
12 12
13 13
14 14
15 6
15 15
16 4
16 16
17 17
18 18
19 19
20 6
20 8
20 20
21 21
22 6
22 22
23 23
24 24
25 5
25 10
25 25
26 8
26 26
27 27
28 28
29 29
30 8
30 9
30 12
30 30
31 31
32 32
33 9
33 33
34 8
34 34
35 14
35 35
36 6
36 36
37 37
38 8
38 3...

result:

ok 400000 numbers

Test #17:

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

input:

7000 200000
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
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
...

output:

2 2
3 3
4 2
4 4
5 5
6 6
7 7
8 8
9 3
9 9
10 4
10 10
11 11
12 12
13 13
14 14
15 6
15 15
16 4
16 16
17 17
18 18
19 19
20 6
20 8
20 20
21 21
22 6
22 22
23 23
24 24
25 5
25 10
25 25
26 8
26 26
27 27
28 28
29 29
30 8
30 9
30 12
30 30
31 31
32 32
33 9
33 33
34 8
34 34
35 14
35 35
36 6
36 36
37 37
38 8
38 3...

result:

ok 400000 numbers

Test #18:

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

input:

9000 200000
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
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
...

output:

2 2
3 3
4 2
4 4
5 5
6 6
7 7
8 8
9 3
9 9
10 4
10 10
11 11
12 12
13 13
14 14
15 6
15 15
16 4
16 16
17 17
18 18
19 19
20 6
20 8
20 20
21 21
22 6
22 22
23 23
24 24
25 5
25 10
25 25
26 8
26 26
27 27
28 28
29 29
30 8
30 9
30 12
30 30
31 31
32 32
33 9
33 33
34 8
34 34
35 14
35 35
36 6
36 36
37 37
38 8
38 3...

result:

ok 400000 numbers

Test #19:

score: 0
Accepted
time: 246ms
memory: 23976kb

input:

19000 200000
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
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...

output:

2 2
3 3
4 2
4 4
5 5
6 6
7 7
8 8
9 3
9 9
10 4
10 10
11 11
12 12
13 13
14 14
15 6
15 15
16 4
16 16
17 17
18 18
19 19
20 6
20 8
20 20
21 21
22 6
22 22
23 23
24 24
25 5
25 10
25 25
26 8
26 26
27 27
28 28
29 29
30 8
30 9
30 12
30 30
31 31
32 32
33 9
33 33
34 8
34 34
35 14
35 35
36 6
36 36
37 37
38 8
38 3...

result:

ok 400000 numbers

Test #20:

score: 0
Accepted
time: 356ms
memory: 35948kb

input:

30000 200000
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
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...

output:

2 2
3 3
4 2
4 4
5 5
6 6
7 7
8 8
9 3
9 9
10 4
10 10
11 11
12 12
13 13
14 14
15 6
15 15
16 4
16 16
17 17
18 18
19 19
20 6
20 8
20 20
21 21
22 6
22 22
23 23
24 24
25 5
25 10
25 25
26 8
26 26
27 27
28 28
29 29
30 8
30 9
30 12
30 30
31 31
32 32
33 9
33 33
34 8
34 34
35 14
35 35
36 6
36 36
37 37
38 8
38 3...

result:

ok 400000 numbers

Test #21:

score: 0
Accepted
time: 538ms
memory: 58504kb

input:

50000 200000
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
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...

output:

2 2
3 3
4 2
4 4
5 5
6 6
7 7
8 8
9 3
9 9
10 4
10 10
11 11
12 12
13 13
14 14
15 6
15 15
16 4
16 16
17 17
18 18
19 19
20 6
20 8
20 20
21 21
22 6
22 22
23 23
24 24
25 5
25 10
25 25
26 8
26 26
27 27
28 28
29 29
30 8
30 9
30 12
30 30
31 31
32 32
33 9
33 33
34 8
34 34
35 14
35 35
36 6
36 36
37 37
38 8
38 3...

result:

ok 400000 numbers

Test #22:

score: 0
Accepted
time: 765ms
memory: 91400kb

input:

78778 200000
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
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...

output:

2 2
3 3
4 2
4 4
5 5
6 6
7 7
8 8
9 3
9 9
10 4
10 10
11 11
12 12
13 13
14 14
15 6
15 15
16 4
16 16
17 17
18 18
19 19
20 6
20 8
20 20
21 21
22 6
22 22
23 23
24 24
25 5
25 10
25 25
26 8
26 26
27 27
28 28
29 29
30 8
30 9
30 12
30 30
31 31
32 32
33 9
33 33
34 8
34 34
35 14
35 35
36 6
36 36
37 37
38 8
38 3...

result:

ok 400000 numbers

Test #23:

score: 0
Accepted
time: 1861ms
memory: 233200kb

input:

200000 200000
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
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
9...

output:

2 2
3 3
4 2
4 4
5 5
6 6
7 7
8 8
9 3
9 9
10 4
10 10
11 11
12 12
13 13
14 14
15 6
15 15
16 4
16 16
17 17
18 18
19 19
20 6
20 8
20 20
21 21
22 6
22 22
23 23
24 24
25 5
25 10
25 25
26 8
26 26
27 27
28 28
29 29
30 8
30 9
30 12
30 30
31 31
32 32
33 9
33 33
34 8
34 34
35 14
35 35
36 6
36 36
37 37
38 8
38 3...

result:

ok 400000 numbers

Test #24:

score: 0
Accepted
time: 1805ms
memory: 233272kb

input:

200000 200000
200000
200001
200002
200003
200004
200005
200006
200007
200008
200009
200010
200011
200012
200013
200014
200015
200016
200017
200018
200019
200020
200021
200022
200023
200024
200025
200026
200027
200028
200029
200030
200031
200032
200033
200034
200035
200036
200037
200038
200039
200040...

output:

21581 413
21581 546
21581 553
21581 560
21581 567
21581 574
21581 581
21581 21581
21582 369
21582 420
21582 426
21582 438
21582 460
21582 464
21582 466
21582 470
21582 472
21582 476
21582 478
21582 482
21582 488
21582 490
21582 501
21582 630
21582 682
21582 1980
21582 5886
21582 21582
21583 21583
21...

result:

ok 400000 numbers

Test #25:

score: 0
Accepted
time: 1880ms
memory: 233216kb

input:

200000 200000
1234567
1234568
1234569
1234570
1234571
1234572
1234573
1234574
1234575
1234576
1234577
1234578
1234579
1234580
1234581
1234582
1234583
1234584
1234585
1234586
1234587
1234588
1234589
1234590
1234591
1234592
1234593
1234594
1234595
1234596
1234597
1234598
1234599
1234600
1234601
123460...

output:

75656 770
75656 872
75656 880
75656 888
75656 904
75656 917
75656 945
75656 990
75656 998
75656 1002
75656 1006
75656 1010
75656 1014
75656 1018
75656 1026
75656 1030
75656 1034
75656 1038
75656 1042
75656 1046
75656 1054
75656 1058
75656 1062
75656 1100
75656 1108
75656 1116
75656 1124
75656 1911
7...

result:

ok 400000 numbers

Test #26:

score: 0
Accepted
time: 1794ms
memory: 233112kb

input:

200000 200000
2345678
2345679
2345680
2345681
2345682
2345683
2345684
2345685
2345686
2345687
2345688
2345689
2345690
2345691
2345692
2345693
2345694
2345695
2345696
2345697
2345698
2345699
2345700
2345701
2345702
2345703
2345704
2345705
2345706
2345707
2345708
2345709
2345710
2345711
2345712
234571...

output:

123774 1455
123774 1572
123774 1578
123774 1584
123774 1590
123774 1602
123774 1631
123774 1645
123774 1673
123774 1687
123774 1876
123774 1904
123774 1918
123774 2268
123774 4263
123774 7157
123774 123774
123775 49510
123775 123775
123776 1224
123776 1240
123776 1256
123776 1460
123776 1468
123776 ...

result:

ok 400000 numbers

Test #27:

score: 0
Accepted
time: 1891ms
memory: 233148kb

input:

200000 200000
3456789
3456790
3456791
3456792
3456793
3456794
3456795
3456796
3456797
3456798
3456799
3456800
3456801
3456802
3456803
3456804
3456805
3456806
3456807
3456808
3456809
3456810
3456811
3456812
3456813
3456814
3456815
3456816
3456817
3456818
3456819
3456820
3456821
3456822
3456823
345682...

output:

166149 1596
166149 1599
166149 1605
166149 1608
166149 1614
166149 1617
166149 1623
166149 1626
166149 1632
166149 1635
166149 1641
166149 1644
166149 1650
166149 1653
166149 1659
166149 1662
166149 1668
166149 1671
166149 1677
166149 1680
166149 1686
166149 1689
166149 1695
166149 1698
166149 1704
...

result:

ok 400000 numbers

Test #28:

score: 0
Accepted
time: 1846ms
memory: 233188kb

input:

200000 200000
4080708
4080709
4080710
4080711
4080712
4080713
4080714
4080715
4080716
4080717
4080718
4080719
4080720
4080721
4080722
4080723
4080724
4080725
4080726
4080727
4080728
4080729
4080730
4080731
4080732
4080733
4080734
4080735
4080736
4080737
4080738
4080739
4080740
4080741
4080742
408074...

output:

186741 1839
186741 1842
186741 1848
186741 1851
186741 1857
186741 1860
186741 1866
186741 1869
186741 1875
186741 1878
186741 1884
186741 1887
186741 1893
186741 1896
186741 1902
186741 1905
186741 1911
186741 1914
186741 1920
186741 1923
186741 2241
186741 2250
186741 2259
186741 2268
186741 2277
...

result:

ok 400000 numbers

Test #29:

score: 0
Accepted
time: 1845ms
memory: 233200kb

input:

200000 200000
4280708
4280709
4280710
4280711
4280712
4280713
4280714
4280715
4280716
4280717
4280718
4280719
4280720
4280721
4280722
4280723
4280724
4280725
4280726
4280727
4280728
4280729
4280730
4280731
4280732
4280733
4280734
4280735
4280736
4280737
4280738
4280739
4280740
4280741
4280742
428074...

output:

193437 1920
193437 1923
193437 1929
193437 1932
193437 1938
193437 1941
193437 1947
193437 1950
193437 1956
193437 1959
193437 2277
193437 2286
193437 2295
193437 2304
193437 2313
193437 2322
193437 193437
193438 2107
193438 2121
193438 2135
193438 2149
193438 2324
193438 2338
193438 2352
193438 236...

result:

ok 400000 numbers

Test #30:

score: 0
Accepted
time: 1851ms
memory: 233264kb

input:

200000 200000
4400000
4400001
4400002
4400003
4400004
4400005
4400006
4400007
4400008
4400009
4400010
4400011
4400012
4400013
4400014
4400015
4400016
4400017
4400018
4400019
4400020
4400021
4400022
4400023
4400024
4400025
4400026
4400027
4400028
4400029
4400030
4400031
4400032
4400033
4400034
440003...

output:

197380 2015
197380 2025
197380 2035
197380 2045
197380 2055
197380 2065
197380 2075
197380 2095
197380 2105
197380 2115
197380 2125
197380 2135
197380 2145
197380 5254
197380 7384
197380 22240
197380 59214
197380 78952
197380 197380
197381 197381
197382 1719
197382 1725
197382 1731
197382 1737
19738...

result:

ok 400000 numbers

Test #31:

score: 0
Accepted
time: 1783ms
memory: 233204kb

input:

200000 200000
5000000
5000001
5000002
5000003
5000004
5000005
5000006
5000007
5000008
5000009
5000010
5000011
5000012
5000013
5000014
5000015
5000016
5000017
5000018
5000019
5000020
5000021
5000022
5000023
5000024
5000025
5000026
5000027
5000028
5000029
5000030
5000031
5000032
5000033
5000034
500003...

output:

-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
...

result:

ok 400000 numbers

Test #32:

score: 0
Accepted
time: 1867ms
memory: 233140kb

input:

200000 200000
39999800001
39999800002
39999800003
39999800004
39999800005
39999800006
39999800007
39999800008
39999800009
39999800010
39999800011
39999800012
39999800013
39999800014
39999800015
39999800016
39999800017
39999800018
39999800019
39999800020
39999800021
39999800022
39999800023
3999980002...

output:

-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
...

result:

ok 400000 numbers

Test #33:

score: 0
Accepted
time: 1825ms
memory: 233200kb

input:

200000 200000
1
11
21
31
41
51
61
71
81
91
101
111
121
131
141
151
161
171
181
191
201
211
221
231
241
251
261
271
281
291
301
311
321
331
341
351
361
371
381
391
401
411
421
431
441
451
461
471
481
491
501
511
521
531
541
551
561
571
581
591
601
611
621
631
641
651
661
671
681
691
701
711
721
731
7...

output:

2 2
10 4
17 17
24 24
30 9
35 35
41 41
46 46
51 51
56 56
62 12
66 66
71 71
76 14
80 24
84 15
89 89
95 20
100 10
104 104
110 18
113 113
117 117
121 121
126 20
131 131
135 54
140 16
142 142
146 146
151 151
156 22
160 160
165 45
169 13
172 20
176 20
180 72
184 184
188 26
190 190
195 78
198 198
202 202
2...

result:

ok 400000 numbers

Test #34:

score: 0
Accepted
time: 1846ms
memory: 233208kb

input:

200000 200000
1
21
41
61
81
101
121
141
161
181
201
221
241
261
281
301
321
341
361
381
401
421
441
461
481
501
521
541
561
581
601
621
641
661
681
701
721
741
761
781
801
821
841
861
881
901
921
941
961
981
1001
1021
1041
1061
1081
1101
1121
1141
1161
1181
1201
1221
1241
1261
1281
1301
1321
1341
13...

output:

2 2
17 17
30 9
41 41
51 51
62 12
71 71
80 24
89 89
100 10
110 18
117 117
126 20
135 54
142 142
151 151
160 160
169 13
176 20
184 184
190 190
198 198
205 205
214 24
220 66
228 26
235 35
243 243
250 250
258 32
265 35
272 64
280 34
286 78
293 293
300 34
306 38
312 42
319 319
325 40
332 38
338 338
345 3...

result:

ok 400000 numbers

Test #35:

score: 0
Accepted
time: 1881ms
memory: 233204kb

input:

200000 200000
1
31
61
91
121
151
181
211
241
271
301
331
361
391
421
451
481
511
541
571
601
631
661
691
721
751
781
811
841
871
901
931
961
991
1021
1051
1081
1111
1141
1171
1201
1231
1261
1291
1321
1351
1381
1411
1441
1471
1501
1531
1561
1591
1621
1651
1681
1711
1741
1771
1801
1831
1861
1891
1921
...

output:

2 2
24 24
41 41
56 56
71 71
84 15
100 10
113 113
126 20
140 16
151 151
165 45
176 20
188 26
198 198
209 209
220 66
230 230
243 243
255 27
265 35
275 275
286 78
296 296
306 38
315 315
325 40
335 134
345 345
355 355
365 45
374 88
382 42
393 36
401 401
410 60
418 114
429 36
438 54
447 39
456 456
465 46...

result:

ok 400000 numbers

Test #36:

score: 0
Accepted
time: 1862ms
memory: 233268kb

input:

200000 200000
1
18
35
52
69
86
103
120
137
154
171
188
205
222
239
256
273
290
307
324
341
358
375
392
409
426
443
460
477
494
511
528
545
562
579
596
613
630
647
664
681
698
715
732
749
766
783
800
817
834
851
868
885
902
919
936
953
970
987
1004
1021
1038
1055
1072
1089
1106
1123
1140
1157
1174
11...

output:

2 2
15 15
26 8
36 6
45 45
54 54
63 15
70 70
78 15
85 34
95 20
102 102
110 110
118 18
125 50
133 133
140 24
146 22
154 42
162 30
169 13
174 174
182 35
188 28
194 26
200 80
206 26
213 213
220 26
225 35
230 230
238 56
245 98
251 251
257 257
263 263
270 25
275 110
282 32
287 287
293 293
298 298
304 304
...

result:

ok 400000 numbers

Test #37:

score: 0
Accepted
time: 1868ms
memory: 233136kb

input:

200000 200000
13
32
51
70
89
108
127
146
165
184
203
222
241
260
279
298
317
336
355
374
393
412
431
450
469
488
507
526
545
564
583
602
621
640
659
678
697
716
735
754
773
792
811
830
849
868
887
906
925
944
963
982
1001
1020
1039
1058
1077
1096
1115
1134
1153
1172
1191
1210
1229
1248
1267
1286
130...

output:

11 11
25 5
35 35
46 10
55 55
65 65
74 74
81 15
91 91
100 100
110 33
118 18
126 20
135 25
141 141
150 45
159 159
167 167
173 173
182 24
188 188
195 195
202 202
209 57
216 28
222 222
230 28
236 236
245 98
252 45
259 42
265 106
272 64
280 25
286 34
291 291
298 36
305 40
310 93
317 317
323 76
328 328
33...

result:

ok 400000 numbers

Test #38:

score: 0
Accepted
time: 1832ms
memory: 233224kb

input:

200000 200000
18
41
64
87
110
133
156
179
202
225
248
271
294
317
340
363
386
409
432
455
478
501
524
547
570
593
616
639
662
685
708
731
754
777
800
823
846
869
892
915
938
961
984
1007
1030
1053
1076
1099
1122
1145
1168
1191
1214
1237
1260
1283
1306
1329
1352
1375
1398
1421
1444
1467
1490
1513
153...

output:

15 15
30 9
43 43
55 15
66 18
76 76
86 86
99 27
110 30
119 119
130 39
140 16
148 24
159 159
168 168
176 48
186 186
194 26
203 35
210 210
220 28
228 26
236 24
246 27
255 25
262 30
270 50
279 279
286 286
295 25
302 36
309 33
317 317
324 38
331 331
339 339
348 33
355 40
362 362
369 369
376 38
382 42
390...

result:

ok 400000 numbers

Test #39:

score: 0
Accepted
time: 1746ms
memory: 233200kb

input:

200000 4
1
4480708
4480709
1234567

output:

2 2
200000 200000
-1 -1
75656 770

result:

ok 8 numbers