QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#327035#7841. Boat CommuterGuanYunchangAC ✓87ms16124kbC++98905b2024-02-14 18:11:092024-02-14 18:11:10

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3764kb

input:

3 3 5
1 1
1 2
1 2
3 1
2 3

output:

2 100 100 

result:

ok single line: '2 100 100 '

Test #2:

score: 0
Accepted
time: 9ms
memory: 3624kb

input:

50 10 100000
16 6
7 1
18 1
39 3
30 3
27 5
27 1
25 8
8 4
30 5
48 10
20 1
25 9
40 1
1 8
15 6
24 5
49 9
46 1
42 8
35 4
47 4
28 6
16 7
46 9
30 9
32 8
8 7
40 5
29 10
48 6
42 2
25 8
16 5
41 6
23 7
40 10
33 9
50 8
13 9
41 3
27 5
38 6
7 3
46 10
26 4
33 5
31 9
27 7
50 10
37 5
9 6
30 2
7 8
27 4
20 9
25 4
47 9...

output:

94844 94854 93814 91551 95910 91226 92395 94770 92170 93178 

result:

ok single line: '94844 94854 93814 91551 95910 91226 92395 94770 92170 93178 '

Test #3:

score: 0
Accepted
time: 87ms
memory: 16044kb

input:

50 100000 100000
15 96740
22 10089
40 13683
13 78680
17 23471
40 32221
37 81743
49 39664
10 89736
3 92228
43 44871
22 91538
42 89149
42 31355
37 67861
44 49843
31 16350
35 54987
28 4360
6 20100
21 36548
25 3957
21 55315
47 2666
11 94150
27 79681
35 47527
31 84052
45 98448
48 26415
21 24159
39 84014
...

output:

0 8 100 0 100 100 28 100 100 100 100 69 200 100 21 20 0 100 100 100 110 27 0 0 0 100 100 100 100 0 0 100 0 100 119 64 0 19 48 0 114 0 0 100 100 0 116 100 0 24 100 0 6 100 0 100 0 126 100 100 100 100 100 100 0 16 0 100 100 6 100 100 100 0 100 0 100 113 0 0 0 100 0 24 0 100 0 100 0 100 100 100 100 11 ...

result:

ok single line: '0 8 100 0 100 100 28 100 100 1... 100 100 0 100 0 100 0 0 0 100 '

Test #4:

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

input:

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

output:

100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

result:

ok single line: '100 100 100 100 100 100 100 10...00 100 100 100 100 100 100 100 '

Test #5:

score: 0
Accepted
time: 6ms
memory: 4868kb

input:

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

output:

100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

result:

ok single line: '100 100 100 100 100 100 100 10...00 100 100 100 100 100 100 100 '

Test #6:

score: 0
Accepted
time: 78ms
memory: 16084kb

input:

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

output:

100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

result:

ok single line: '100 100 100 100 100 100 100 10...00 100 100 100 100 100 100 100 '

Test #7:

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

input:

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

output:

100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

result:

ok single line: '100 100 100 100 100 100 100 10...00 100 100 100 100 100 100 100 '

Test #8:

score: 0
Accepted
time: 3ms
memory: 4852kb

input:

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

output:

100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

result:

ok single line: '100 100 100 100 100 100 100 10...00 100 100 100 100 100 100 100 '

Test #9:

score: 0
Accepted
time: 67ms
memory: 16124kb

input:

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

output:

100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

result:

ok single line: '100 100 100 100 100 100 100 10...00 100 100 100 100 100 100 100 '

Test #10:

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

input:

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

output:

100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

result:

ok single line: '100 100 100 100 100 100 100 10...00 100 100 100 100 100 100 100 '

Test #11:

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

input:

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

output:

100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

result:

ok single line: '100 100 100 100 100 100 100 10...00 100 100 100 100 100 100 100 '

Test #12:

score: 0
Accepted
time: 84ms
memory: 16044kb

input:

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

output:

100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

result:

ok single line: '100 100 100 100 100 100 100 10...00 100 100 100 100 100 100 100 '

Test #13:

score: 0
Accepted
time: 19ms
memory: 8860kb

input:

12 42221 27267
5 15088
6 26119
3 27079
12 30147
3 24500
8 14098
1 32646
9 26869
3 21340
6 5000
3 11765
7 29174
4 6819
10 37019
7 20440
11 40434
4 5514
12 26791
2 30275
10 42044
1 1177
1 26575
7 24534
2 33043
1 10723
10 24718
11 18160
12 6108
4 29702
12 36013
6 19124
9 4360
6 20252
12 32137
6 31466
8...

output:

100 100 100 0 0 0 0 100 0 100 0 200 0 100 0 0 0 0 100 100 0 0 0 0 0 100 100 0 0 0 0 0 0 0 100 0 1 100 0 2 100 3 0 100 0 0 0 0 2 0 100 0 100 0 1 0 0 100 4 100 100 0 0 100 0 100 0 3 0 0 0 0 0 0 100 0 0 100 100 0 100 0 100 0 0 100 100 0 0 4 100 2 100 0 0 2 0 0 8 9 0 0 0 0 100 6 100 100 0 0 100 0 101 3 ...

result:

ok single line: '100 100 100 0 0 0 0 100 0 100 ... 100 0 0 100 100 0 2 0 5 0 100 '

Test #14:

score: 0
Accepted
time: 24ms
memory: 10176kb

input:

33 52421 10302
6 13942
7 4155
14 18469
22 46701
12 28014
14 19350
5 9810
1 25086
29 48782
21 48560
31 51280
2 45026
10 35
15 970
25 26559
32 21485
23 48022
10 16113
9 12469
9 43502
30 2487
18 40005
9 48033
13 28425
29 32459
2 25001
31 6923
25 46573
28 15867
30 39287
12 26986
8 21668
5 42675
33 37877...

output:

0 0 0 0 0 0 0 0 100 0 0 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 100 0 100 0 17 100 0 100 0 0 0 100 0 100 0 100 0 0 100 0 0 100 0 0 0 0 0 0 0 0 0 100 0 100 0 0 0 0 100 0 0 0 0 0 0 0 0 100 0 0 0 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 100 100 100 0 100 0 0 0 0 0 100 0 100 0 100 100 100 100 0 0 0 0 0 0 0 0...

result:

ok single line: '0 0 0 0 0 0 0 0 100 0 0 100 0 ...100 100 0 0 30 0 100 0 100 0 0 '

Test #15:

score: 0
Accepted
time: 43ms
memory: 14276kb

input:

2 85457 43320
2 21137
2 43723
2 64263
1 29749
1 24086
2 76652
2 60508
2 77185
1 38527
2 11194
2 741
1 77129
1 74401
2 2494
2 31896
2 36895
2 30091
2 51598
1 20628
2 13376
2 35199
1 27598
2 5879
2 1290
2 51278
2 55151
2 41079
2 55327
2 53324
1 66569
1 23262
2 71032
2 80310
2 22785
2 60001
1 51864
1 7...

output:

100 100 0 0 0 0 200 0 0 100 0 0 1 100 0 0 1 0 101 1 100 0 100 0 100 0 100 1 0 100 100 0 200 0 0 0 0 100 100 0 1 0 0 0 0 100 0 101 0 100 0 100 0 100 0 100 0 1 0 0 0 0 100 0 0 0 100 101 0 0 0 0 100 0 1 100 100 0 100 100 0 100 0 0 100 100 100 0 100 100 0 0 0 0 1 0 0 0 0 0 100 0 0 100 100 0 0 1 0 100 10...

result:

ok single line: '100 100 0 0 0 0 200 0 0 100 0 ... 0 0 0 0 0 100 100 100 0 0 0 0 '

Test #16:

score: 0
Accepted
time: 47ms
memory: 10076kb

input:

14 51772 68350
12 26926
11 26290
3 2430
2 32150
3 5921
8 14405
11 11286
2 21291
10 39898
11 19847
4 26517
14 48104
13 38731
11 51270
6 10479
1 38335
13 36048
2 20924
10 27313
13 33389
13 12987
7 46606
7 29321
13 7335
10 47633
12 23587
9 11954
2 10850
13 16305
12 1944
13 21700
3 20564
10 46433
1 1671...

output:

0 0 4 5 7 100 3 103 100 0 100 100 10 104 0 0 100 2 100 10 0 6 100 107 0 0 0 100 7 100 106 108 2 100 1 100 100 100 100 4 100 11 100 0 8 100 2 100 0 4 0 0 8 0 6 100 100 2 0 100 12 7 0 100 100 0 108 0 3 0 4 11 100 100 0 100 100 100 100 100 5 0 5 100 0 100 100 0 0 100 100 100 0 100 6 100 104 100 100 10 ...

result:

ok single line: '0 0 4 5 7 100 3 103 100 0 100 ...0 100 7 109 0 100 100 100 14 8 '

Test #17:

score: 0
Accepted
time: 46ms
memory: 10856kb

input:

27 57681 64012
19 9229
8 27616
5 24103
27 39178
2 43579
9 11961
7 14952
7 48819
17 47353
13 17298
15 2243
18 7640
25 13443
2 30900
18 37795
22 39508
4 50989
13 4555
17 26211
15 52931
20 14984
27 56263
5 28780
27 31335
10 14970
5 40538
5 26424
23 2266
23 20433
12 48282
8 12678
14 54262
20 31049
13 47...

output:

0 0 100 8 100 100 100 0 100 117 0 106 100 3 0 0 4 0 0 100 0 0 1 116 0 0 100 0 100 0 0 100 18 25 0 100 1 100 100 0 0 100 100 0 0 105 117 1 7 5 0 0 11 100 4 100 0 101 100 100 0 100 16 20 0 0 15 200 101 7 23 0 0 100 0 15 100 2 9 100 0 100 0 100 1 0 11 100 100 18 4 0 0 0 100 0 120 0 109 122 100 100 100 ...

result:

ok single line: '0 0 100 8 100 100 100 0 100 11...1 23 100 100 0 0 0 100 26 0 18 '

Test #18:

score: 0
Accepted
time: 21ms
memory: 7852kb

input:

24 34005 22304
12 10958
24 1082
24 26467
11 8794
8 13172
10 6116
22 17398
3 6148
15 3447
14 21848
11 7315
12 5351
14 17045
16 23777
17 18932
1 24087
14 8048
24 33363
3 17372
14 32696
14 18362
8 14208
23 24850
2 292
16 14586
13 19991
22 14894
15 2115
3 8014
20 1512
15 30303
7 8342
7 26762
2 14430
11 ...

output:

0 0 0 100 100 100 18 100 0 0 0 0 100 0 0 100 0 0 0 100 100 216 100 0 100 0 100 0 100 10 0 0 14 16 0 0 0 100 100 5 0 14 4 100 117 0 100 100 100 0 11 0 8 10 100 100 4 0 9 13 0 2 113 0 100 100 100 0 0 0 100 100 0 0 0 100 100 0 100 100 0 0 0 0 0 100 100 0 0 100 100 0 0 0 0 100 4 100 0 0 3 0 0 0 0 0 100 ...

result:

ok single line: '0 0 0 100 100 100 18 100 0 0 0...20 100 0 0 0 0 100 0 100 100 0 '

Test #19:

score: 0
Accepted
time: 55ms
memory: 13976kb

input:

4 83440 58613
3 16959
2 7030
3 2169
4 33622
2 31600
4 4409
3 67199
1 31678
4 31463
3 62616
3 45425
2 43654
1 79626
3 32033
4 34386
3 34298
1 19363
3 43724
2 63106
1 77356
2 53529
2 53506
1 36453
4 73952
1 58543
3 71805
1 39914
1 8386
3 13221
2 19733
4 76699
1 79925
4 49239
1 34139
2 74707
1 44418
2 ...

output:

0 0 0 100 2 100 0 0 100 0 0 100 3 100 0 0 0 0 3 0 100 0 0 0 0 100 0 0 0 0 100 100 0 100 100 100 100 0 0 0 100 0 0 100 0 0 100 0 100 0 100 100 100 100 0 100 100 0 100 100 0 102 0 0 0 0 0 200 3 0 0 0 0 0 100 0 100 0 0 0 100 0 100 0 0 100 3 100 100 100 0 2 100 0 0 0 0 0 0 100 0 100 100 0 2 2 0 0 100 0 ...

result:

ok single line: '0 0 0 100 2 100 0 0 100 0 0 10...00 103 0 0 0 0 0 0 0 0 100 3 0 '

Test #20:

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

input:

47 11394 80666
35 7195
25 8458
11 8649
27 1602
19 3696
20 2840
15 5795
33 5544
38 1320
47 2981
29 594
21 10054
41 10609
32 5819
32 5721
40 10030
21 9805
30 7950
7 10998
24 8120
47 5692
29 5354
21 5155
31 6688
37 2020
26 6817
37 7286
43 1785
13 2557
33 9836
40 3517
16 9223
33 5833
30 3127
13 6070
4 1...

output:

49 126 72 42 150 57 118 12 102 152 123 79 130 63 138 144 78 116 76 164 184 46 80 8 140 123 122 114 64 111 125 71 83 131 145 48 30 12 52 158 56 115 161 142 78 56 69 155 24 59 229 151 185 215 153 42 209 60 139 180 129 120 227 96 137 143 26 30 53 104 142 163 136 137 143 86 44 128 126 164 194 62 43 151 ...

result:

ok single line: '49 126 72 42 150 57 118 12 102... 151 147 144 250 231 21 164 73 '

Test #21:

score: 0
Accepted
time: 21ms
memory: 3916kb

input:

6 2979 65794
2 1232
6 2109
4 63
4 2472
1 2675
4 1271
6 1427
2 1833
4 2069
2 1077
2 1090
6 2022
5 722
6 931
6 2037
5 2612
1 585
3 1241
5 159
4 277
4 839
1 1583
6 1485
4 2325
3 528
2 1067
3 1635
2 2088
2 1138
4 1192
1 1115
1 990
3 2108
3 1939
1 1951
2 969
1 1082
5 2061
2 324
3 495
3 1911
5 101
1 2911
...

output:

326 229 515 216 416 329 322 315 228 119 15 15 120 24 230 720 34 432 217 325 116 215 318 216 213 418 107 418 119 128 218 24 513 118 227 615 122 37 423 131 231 117 427 222 314 542 319 225 209 228 117 325 330 312 114 130 329 229 319 314 233 216 21 131 130 128 325 320 120 121 127 33 118 224 517 218 124 ...

result:

ok single line: '326 229 515 216 416 329 322 31...415 127 236 231 420 323 20 323 '

Test #22:

score: 0
Accepted
time: 41ms
memory: 14404kb

input:

35 87234 10085
32 23217
24 76367
27 61808
11 75310
1 70741
17 52781
25 76560
18 24571
19 62664
3 25525
25 41468
27 74749
24 30434
35 22003
19 53805
16 24018
17 42951
21 57534
20 63867
18 10192
31 19024
7 15572
10 83625
21 40096
16 82835
26 32220
1 96
4 77404
9 72610
20 77755
5 68624
27 4224
13 80058...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 100 0 0 100 100 0 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 100 0 0 0 0 0 100 100 0 0 0 0 0 0 0 100 0 0 0 0 0 100 0 0 0 0 0 0 0 0 4 0 0 0 0 100 100 0 0 0 0 23 0 28 100 0 0 18 0 0 0 0 0 0 0 100 100 0 0 0 0 0 0 0 0 0 100 0 0 0 0 0 0 0 0 0 0 0 0 0 100...

result:

ok single line: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #23:

score: 0
Accepted
time: 9ms
memory: 4360kb

input:

6 6064 21758
1 1573
2 4729
1 3866
5 1034
5 2491
6 5123
1 2945
3 3196
1 1679
5 1413
3 5388
1 907
4 600
2 1163
4 5212
3 3951
5 2788
5 454
4 619
6 5641
2 283
1 5757
1 4904
2 4046
2 1968
1 1084
6 3363
4 19
3 3187
4 1905
1 5591
2 3299
5 1217
4 5425
6 88
1 250
6 3337
5 19
6 3036
2 3490
1 2358
3 1630
6 399...

output:

2 103 2 5 6 8 105 100 3 300 100 105 3 101 102 101 300 102 104 6 107 101 6 3 101 4 104 105 103 4 105 107 105 109 100 4 101 7 100 108 0 200 106 109 6 104 102 5 101 5 2 203 109 101 2 106 1 103 0 200 101 1 200 103 105 201 105 107 4 7 8 3 102 2 1 104 104 300 101 109 104 204 100 100 6 100 3 3 1 201 0 3 10...

result:

ok single line: '2 103 2 5 6 8 105 100 3 300 10...02 3 0 205 100 2 105 5 106 103 '

Test #24:

score: 0
Accepted
time: 58ms
memory: 15828kb

input:

41 97964 48582
25 81027
36 59647
19 6654
38 69654
30 92494
41 14002
5 39933
34 59996
40 38151
31 7449
13 23936
10 6284
35 19711
17 5436
9 22293
26 48747
32 68901
32 31699
17 80750
5 64907
35 15135
5 11099
21 34758
29 13481
15 62801
19 56310
21 58267
21 38354
17 1978
41 18080
34 3154
8 9834
20 27678
...

output:

0 0 100 0 100 25 0 0 0 100 0 100 0 0 0 0 0 0 0 100 8 0 0 0 0 100 0 0 100 0 100 0 100 100 0 26 13 100 0 0 10 100 0 100 0 0 0 0 100 0 100 0 0 0 0 0 100 100 0 0 100 100 0 100 100 100 0 100 100 0 100 100 0 100 100 36 0 0 0 0 0 0 15 0 100 100 100 0 0 0 0 0 0 0 0 100 0 0 0 100 100 0 0 0 100 0 0 20 0 0 100...

result:

ok single line: '0 0 100 0 100 25 0 0 0 100 0 1...0 5 100 0 100 0 10 100 0 0 0 0 '

Test #25:

score: 0
Accepted
time: 29ms
memory: 4752kb

input:

21 9032 72061
21 5044
11 6923
16 8507
14 2098
3 589
9 1824
18 7120
8 1405
15 3916
8 3930
15 3718
3 3202
16 7185
18 8997
8 8621
17 3748
14 7408
9 5323
19 8431
5 2053
20 781
9 6415
1 4172
11 5454
19 414
10 925
17 234
7 7604
11 1973
13 807
5 6284
14 8461
8 4976
16 7012
1 879
5 3801
19 7848
13 6358
7 46...

output:

113 127 111 154 31 141 40 23 118 145 115 218 113 159 6 35 110 128 119 28 112 18 20 134 142 46 15 23 112 121 117 19 144 33 125 36 42 108 145 0 110 141 119 128 152 122 136 113 156 69 129 22 116 144 120 112 4 7 10 221 40 21 26 208 230 14 120 122 104 107 128 105 139 144 32 133 118 135 53 230 113 29 44 1...

result:

ok single line: '113 127 111 154 31 141 40 23 1...3 29 10 135 22 110 239 125 138 '

Test #26:

score: 0
Accepted
time: 41ms
memory: 6528kb

input:

30 23890 75787
29 13553
18 12462
21 21905
7 4943
2 23688
11 9548
6 23382
29 5562
7 12980
5 20742
4 20377
16 19484
2 5320
8 1128
10 16007
9 16632
19 430
23 4361
8 12265
1 23586
15 22380
20 11970
14 1780
16 23368
14 19640
28 18010
8 6174
20 22815
27 3512
5 9286
20 1328
22 2569
29 10583
6 10202
30 579
...

output:

200 100 8 100 122 107 0 100 129 24 9 2 109 18 128 100 103 100 40 31 9 100 106 105 112 17 20 10 100 7 118 127 9 5 100 118 136 109 109 100 15 100 100 102 101 25 2 6 11 100 7 135 139 130 141 109 119 103 100 15 100 1 110 106 22 106 118 100 121 8 0 100 117 0 101 105 109 110 100 1 146 111 0 200 114 100 12...

result:

ok single line: '200 100 8 100 122 107 0 100 12...5 4 5 3 27 100 17 38 38 9 45 9 '

Test #27:

score: 0
Accepted
time: 31ms
memory: 9420kb

input:

40 46483 30422
17 26620
15 2016
7 28819
25 4698
38 25869
34 22881
36 34518
19 33003
32 3901
7 40817
37 35208
34 19976
23 42094
12 16862
4 39666
3 23766
4 22044
14 46252
30 6813
12 8865
14 24240
9 34214
38 28412
1 35863
20 10993
15 27639
15 23373
30 34924
25 26152
5 16479
35 16108
19 20302
10 34144
2...

output:

0 100 100 100 0 0 100 0 0 100 0 3 0 100 100 0 0 9 0 100 0 0 0 100 0 0 0 100 100 0 0 119 0 0 100 0 0 100 0 100 0 0 0 0 100 0 0 0 100 0 100 15 0 0 100 100 100 0 0 6 0 100 100 100 0 100 8 6 100 0 0 0 100 0 100 0 100 100 0 0 16 12 0 100 100 18 100 100 3 100 0 100 3 0 0 100 100 4 100 100 0 109 0 100 0 10...

result:

ok single line: '0 100 100 100 0 0 100 0 0 100 ... 100 0 100 100 0 100 100 0 0 0 '

Test #28:

score: 0
Accepted
time: 26ms
memory: 4472kb

input:

27 6792 69353
24 825
19 136
7 5321
5 3820
6 965
1 4502
3 179
4 5399
13 6110
11 721
21 3209
3 433
22 3843
22 6117
22 617
8 4319
27 2913
15 6751
4 4749
3 962
26 3444
10 4417
11 4019
10 289
27 6131
8 4868
2 5457
7 6065
23 3885
8 2001
17 4020
25 3340
2 4448
9 5294
10 2593
25 2702
21 3137
8 2970
22 4527
...

output:

120 154 74 22 33 147 147 70 161 40 78 75 139 172 157 164 160 42 139 222 26 39 182 147 121 128 126 16 62 46 101 27 186 29 72 29 174 229 58 136 29 154 74 8 120 179 193 286 42 33 148 135 48 43 36 164 358 111 124 114 186 37 24 121 45 178 175 134 65 109 144 153 149 62 134 51 119 162 51 29 39 118 46 34 39...

result:

ok single line: '120 154 74 22 33 147 147 70 16...1 103 168 29 182 51 155 42 148 '

Test #29:

score: 0
Accepted
time: 21ms
memory: 12628kb

input:

5 72352 246
4 17682
5 30891
3 53053
4 64856
4 72337
2 8682
2 36325
5 63808
3 32211
5 2866
1 35237
2 22682
1 63523
4 49391
1 45145
1 71260
3 50657
3 11194
2 38423
4 49926
3 55725
4 14076
2 62726
1 39399
2 63005
1 71395
1 27868
5 41070
5 60502
1 16754
5 67671
1 12226
3 35027
3 40006
2 8367
4 67145
5 4...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #30:

score: 0
Accepted
time: 70ms
memory: 15892kb

input:

10 96980 61372
7 62961
6 90245
3 95489
6 79165
1 34343
1 87475
10 53389
4 85012
3 23472
4 26636
2 55819
1 77676
1 76233
5 39226
2 2482
6 81500
6 55310
4 61318
2 63948
9 39609
10 75825
9 26702
1 77841
2 93790
2 35481
10 4552
7 65833
10 62004
4 95127
5 96052
4 18317
5 80713
3 35686
3 42786
9 27998
1 6...

output:

0 100 0 100 0 0 0 6 0 0 0 0 0 0 0 0 100 0 4 0 100 0 0 100 0 100 1 1 100 0 9 100 0 0 0 0 0 0 0 0 0 2 0 100 100 100 100 0 104 100 0 100 0 103 0 0 0 0 1 6 0 0 100 0 0 100 0 2 100 0 0 100 0 0 0 100 0 100 0 100 100 102 0 200 100 0 0 0 5 0 4 0 0 0 0 100 1 0 100 2 0 2 1 0 100 100 0 0 100 100 100 0 100 0 10...

result:

ok single line: '0 100 0 100 0 0 0 6 0 0 0 0 0 ... 102 100 100 100 0 100 100 100 '

Test #31:

score: 0
Accepted
time: 39ms
memory: 9272kb

input:

9 43531 69523
3 42591
7 8186
4 27717
5 28680
4 651
3 397
8 32068
2 12178
7 16410
1 24447
1 9603
4 19585
4 3554
4 12967
7 20402
4 6573
1 29263
9 37796
5 24545
8 6276
9 10525
6 22515
4 14105
4 20628
8 5333
4 42376
4 43241
1 39938
8 30728
9 5659
1 25969
6 33814
4 22075
1 32185
8 8928
7 24424
7 11275
5 ...

output:

0 103 2 103 0 0 0 100 9 0 106 2 1 100 101 1 100 102 3 100 102 100 1 100 0 101 100 0 100 4 100 100 100 1 0 8 100 100 0 2 0 1 6 3 100 100 5 1 102 100 102 5 100 200 100 101 100 107 100 2 0 107 4 100 100 0 6 0 0 0 100 0 2 101 1 2 100 101 100 4 100 5 112 100 0 100 7 10 100 100 100 0 0 0 100 100 0 0 0 0 1...

result:

ok single line: '0 103 2 103 0 0 0 100 9 0 106 ...01 0 102 3 3 100 100 0 112 0 8 '

Test #32:

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

input:

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

output:

100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

result:

ok single line: '100 100 100 100 100 100 100 10...00 100 100 100 100 100 100 100 '

Test #33:

score: 0
Accepted
time: 8ms
memory: 4848kb

input:

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

output:

100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

result:

ok single line: '100 100 100 100 100 100 100 10...00 100 100 100 100 100 100 100 '

Test #34:

score: 0
Accepted
time: 50ms
memory: 9812kb

input:

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

output:

100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

result:

ok single line: '100 100 100 100 100 100 100 10...00 100 100 100 100 100 100 100 '

Test #35:

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

input:

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

output:

100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

result:

ok single line: '100 100 100 100 100 100 100 10...00 100 100 100 100 100 100 100 '

Test #36:

score: 0
Accepted
time: 8ms
memory: 4796kb

input:

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

output:

100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

result:

ok single line: '100 100 100 100 100 100 100 10...00 100 100 100 100 100 100 100 '

Test #37:

score: 0
Accepted
time: 45ms
memory: 9752kb

input:

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

output:

100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

result:

ok single line: '100 100 100 100 100 100 100 10...00 100 100 100 100 100 100 100 '

Test #38:

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

input:

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

output:

100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

result:

ok single line: '100 100 100 100 100 100 100 10...00 100 100 100 100 100 100 100 '

Test #39:

score: 0
Accepted
time: 8ms
memory: 4856kb

input:

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

output:

100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

result:

ok single line: '100 100 100 100 100 100 100 10...00 100 100 100 100 100 100 100 '

Test #40:

score: 0
Accepted
time: 46ms
memory: 9876kb

input:

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

output:

100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

result:

ok single line: '100 100 100 100 100 100 100 10...00 100 100 100 100 100 100 100 '

Test #41:

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

input:

2 1 1
1 1

output:

100 

result:

ok single line: '100 '

Test #42:

score: 0
Accepted
time: 47ms
memory: 16000kb

input:

50 100000 100000
44 82157
44 82157
33 82157
33 82157
15 82157
15 82157
26 82157
26 82157
42 82157
42 82157
29 82157
29 82157
39 82157
39 82157
25 82157
25 82157
12 82157
12 82157
28 82157
28 82157
1 82157
1 82157
21 82157
21 82157
2 82157
2 82157
48 82157
48 82157
35 82157
35 82157
50 82157
50 82157...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #43:

score: 0
Accepted
time: 52ms
memory: 16004kb

input:

50 100000 100000
1 82157
50 82157
50 82157
1 82157
50 82157
1 82157
1 82157
50 82157
1 82157
50 82157
50 82157
1 82157
50 82157
1 82157
50 82157
1 82157
1 82157
50 82157
1 82157
50 82157
50 82157
1 82157
50 82157
1 82157
1 82157
50 82157
1 82157
50 82157
50 82157
1 82157
1 82157
50 82157
1 82157
50 ...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '

Test #44:

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

input:

3 1 1
1 1

output:

100 

result:

ok single line: '100 '

Test #45:

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

input:

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

output:

0 1 0 2 0 100 100 102 100 0 

result:

ok single line: '0 1 0 2 0 100 100 102 100 0 '

Test #46:

score: 0
Accepted
time: 6ms
memory: 3604kb

input:

5 1 100000
2 1
2 1
1 1
2 1
5 1
5 1
2 1
1 1
3 1
1 1
5 1
1 1
2 1
4 1
3 1
5 1
3 1
4 1
2 1
3 1
3 1
1 1
3 1
4 1
5 1
5 1
3 1
1 1
5 1
2 1
4 1
3 1
4 1
5 1
1 1
5 1
4 1
5 1
5 1
1 1
4 1
1 1
3 1
4 1
1 1
4 1
5 1
4 1
1 1
4 1
5 1
3 1
3 1
2 1
4 1
1 1
5 1
2 1
2 1
3 1
5 1
4 1
1 1
3 1
1 1
2 1
5 1
4 1
2 1
5 1
1 1
4 1
1...

output:

1070808 

result:

ok single line: '1070808 '

Test #47:

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

input:

7 2 1000
5 2
3 2
5 2
2 1
6 2
7 2
2 1
5 1
6 1
5 2
3 1
4 2
5 1
5 2
6 2
4 1
7 1
2 2
1 1
1 2
7 1
7 1
4 2
1 2
4 2
4 2
5 2
7 2
3 1
1 2
2 1
1 2
2 1
6 1
4 2
7 1
3 1
6 2
7 1
4 2
2 1
5 1
1 1
7 2
4 1
1 2
1 1
4 2
2 1
5 1
7 2
5 1
3 1
7 1
3 2
3 2
7 1
4 2
2 2
5 2
3 1
4 2
3 1
5 2
2 1
5 2
2 2
6 2
3 2
2 2
3 2
6 1
1 1...

output:

5141 3732 

result:

ok single line: '5141 3732 '

Test #48:

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

input:

13 543 1343
11 227
2 95
1 74
12 373
2 219
8 142
2 463
11 428
1 12
7 348
3 80
3 167
3 298
1 351
9 479
5 302
6 295
8 243
6 168
11 439
1 459
8 409
1 168
5 334
9 7
7 287
12 26
7 449
1 457
8 534
8 235
12 43
2 162
7 270
4 7
4 353
10 91
12 170
1 385
7 6
6 189
8 526
5 199
2 524
13 293
13 108
4 465
1 460
7 3...

output:

5 104 15 101 9 101 5 12 7 13 3 8 0 7 101 7 105 4 100 0 100 100 100 3 100 117 1 100 100 100 0 100 14 20 104 6 1 107 0 7 100 3 9 6 100 101 100 9 101 102 100 100 10 100 4 100 100 5 108 8 5 0 100 2 2 10 0 101 0 15 107 3 200 114 20 3 4 5 4 1 101 106 5 12 100 105 100 300 103 1 105 104 0 3 100 109 0 106 10...

result:

ok single line: '5 104 15 101 9 101 5 12 7 13 3...00 5 108 104 103 100 108 101 6 '

Test #49:

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

input:

50 1 1
13 1

output:

100 

result:

ok single line: '100 '

Test #50:

score: 0
Accepted
time: 6ms
memory: 3528kb

input:

2 1 100000
1 1
1 1
1 1
1 1
2 1
1 1
1 1
1 1
2 1
1 1
1 1
1 1
2 1
2 1
1 1
2 1
2 1
2 1
1 1
1 1
1 1
2 1
2 1
1 1
1 1
2 1
1 1
2 1
2 1
2 1
2 1
2 1
1 1
1 1
1 1
1 1
2 1
2 1
2 1
2 1
1 1
1 1
2 1
1 1
2 1
2 1
1 1
1 1
2 1
1 1
1 1
1 1
1 1
1 1
2 1
2 1
2 1
2 1
1 1
1 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
1 1
1 1
1 1
2 1
1...

output:

2536583 

result:

ok single line: '2536583 '

Test #51:

score: 0
Accepted
time: 47ms
memory: 16040kb

input:

2 100000 1
1 44588

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok single line: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 '