QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#423121#7278. Brought Down the Grading Server?dXqwq#35 1822ms83080kbC++233.1kb2024-05-27 21:12:482024-05-27 21:12:48

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

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

input:

3 2 3
1 2
2 3
2 3

output:

1 2 
2 3 
3 2 

result:

ok 

Test #2:

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

input:

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

output:

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

result:

ok 

Test #3:

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

input:

20 2 12
12 11
1 9
12 12
3 4
3 9
8 3
8 11
10 9
4 3
6 7
11 6
11 3
7 10
12 10
11 10
11 11
11 2
1 12
6 12
2 7

output:

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

result:

ok 

Test #4:

score: 10
Accepted
time: 3ms
memory: 18428kb

input:

20 2 8
7 7
7 8
6 4
7 4
6 2
4 6
1 3
2 3
8 3
6 7
1 5
6 3
2 5
1 4
2 2
6 2
6 3
2 5
5 3
3 3

output:

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

result:

ok 

Test #5:

score: 10
Accepted
time: 3ms
memory: 18132kb

input:

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

output:

13 1 
14 4 
14 13 
17 1 
8 15 
5 14 
3 7 
6 20 
1 9 
11 19 
20 6 
13 11 

result:

ok 

Test #6:

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

input:

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

output:

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

result:

ok 

Test #7:

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

input:

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

output:

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

result:

ok 

Subtask #2:

score: 0
Time Limit Exceeded

Test #8:

score: 15
Accepted
time: 1769ms
memory: 81240kb

input:

100000 2 100000
70318 14894
32116 90327
63866 29061
53683 63612
70370 78264
42647 76881
39251 31741
61186 66491
57686 65819
53278 59145
71962 26052
81040 55279
50859 51310
46800 24546
85013 91165
61530 21890
84003 29099
33573 86182
49212 10639
91851 97312
57682 14067
5243 69674
99007 62508
26290 555...

output:

70318 14894 
90327 32116 
63866 29061 
53683 63612 
70370 78264 
42647 76881 
31741 39251 
66491 61186 
57686 65819 
59145 53278 
26052 71962 
81040 55279 
50859 51310 
24546 46800 
85013 91165 
61530 21890 
29099 84003 
86182 33573 
49212 10639 
91851 97312 
57682 14067 
5243 69674 
62508 99007 
26...

result:

ok 

Test #9:

score: 15
Accepted
time: 59ms
memory: 79808kb

input:

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

output:

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

result:

ok 

Test #10:

score: 15
Accepted
time: 48ms
memory: 80248kb

input:

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

output:

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

result:

ok 

Test #11:

score: 15
Accepted
time: 1719ms
memory: 79056kb

input:

98045 2 95001
27085 59126
75021 23663
67175 78883
3919 90698
20718 67504
49374 44011
1660 3236
71971 79270
24502 90540
54202 9732
14395 88659
56600 52635
21912 17986
92420 56526
40254 3472
64330 20431
9381 56003
57750 45529
45230 9388
83797 53437
75562 47526
63126 45219
71020 87437
50298 2016
21982 ...

output:

27085 59126 
75021 23663 
67175 78883 
3919 90698 
20718 67504 
49374 44011 
3236 1660 
71971 79270 
24502 90540 
54202 9732 
14395 88659 
52635 56600 
17986 21912 
92420 56526 
3472 40254 
20431 64330 
56003 9381 
57750 45529 
45230 9388 
83797 53437 
47526 75562 
63126 45219 
71020 87437 
50298 20...

result:

ok 

Test #12:

score: 15
Accepted
time: 1499ms
memory: 65768kb

input:

89868 2 20001
16598 13223
18759 19981
2642 8681
4102 18080
11473 16749
690 15290
17900 16229
10684 17481
6328 12171
9417 1150
7185 5689
10346 17102
17958 9727
2117 13756
10955 13157
245 2840
5257 5337
16622 6429
17516 10772
13007 19349
11359 2821
14341 8897
3974 2482
16241 17966
18146 15458
3345 158...

output:

16598 13223 
18759 19981 
2642 8681 
4102 18080 
11473 16749 
690 15290 
16229 17900 
17481 10684 
6328 12171 
9417 1150 
7185 5689 
10346 17102 
17958 9727 
2117 13756 
10955 13157 
245 2840 
5257 5337 
16622 6429 
17516 10772 
19349 13007 
2821 11359 
8897 14341 
2482 3974 
16241 17966 
18146 1545...

result:

ok 

Test #13:

score: 15
Accepted
time: 317ms
memory: 72972kb

input:

99006 2 11
7 2
3 10
10 8
1 8
5 2
3 6
6 3
5 3
6 8
7 7
4 7
1 3
7 6
10 5
6 4
9 9
8 4
2 9
6 1
10 7
10 1
9 7
6 9
6 9
3 10
10 10
6 2
7 7
6 5
3 8
4 4
5 2
5 8
8 2
10 9
8 3
7 4
2 2
8 9
8 10
8 9
2 1
1 5
4 7
4 9
6 9
8 10
2 4
6 3
4 1
2 10
3 5
10 7
7 1
4 10
6 6
1 4
4 8
10 9
3 9
5 5
6 1
9 2
2 7
9 5
9 8
1 3
5 6
7 ...

output:

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

result:

ok 

Test #14:

score: 15
Accepted
time: 1822ms
memory: 83080kb

input:

100000 2 100000
53479 25002
53479 63606
53479 40735
53479 83340
53479 40775
53479 11458
53479 8684
53479 60405
45116 53479
67722 53479
26014 53479
87860 53479
55147 53479
53479 22726
53479 67769
53479 129
14600 53479
53479 21514
53479 32164
60088 53479
53479 25415
70946 53479
53479 27091
33386 53479...

output:

25002 53479 
53479 63606 
40735 53479 
53479 83340 
53479 40775 
11458 53479 
53479 8684 
60405 53479 
53479 45116 
67722 53479 
26014 53479 
53479 87860 
55147 53479 
53479 22726 
67769 53479 
53479 129 
14600 53479 
53479 21514 
53479 32164 
60088 53479 
25415 53479 
53479 70946 
53479 27091 
3338...

result:

ok 

Test #15:

score: 0
Time Limit Exceeded

input:

100000 2 90000
8483 66963
63660 79073
41795 20397
1296 84311
3690 21178
21052 31611
51423 14323
34208 82468
83835 2785
50594 28274
59957 10993
34259 64334
89407 73934
14947 61083
53201 89472
61243 33351
76632 58718
67464 85318
54224 45096
84552 76529
44253 30697
43669 3108
26489 64691
79840 85776
76...

output:

66963 8483 
79073 63660 
20397 41795 
1296 84311 
21178 3690 
31611 21052 
14323 51423 
34208 82468 
2785 83835 
28274 50594 
10993 59957 
34259 64334 
89407 73934 
14947 61083 
53201 89472 
33351 61243 
76632 58718 
85318 67464 
45096 54224 
84552 76529 
44253 30697 
43669 3108 
64691 26489 
79840 ...

result:


Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%

Subtask #5:

score: 15
Accepted

Test #56:

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

input:

3 4 3
2 3 2 2
2 3 3 2
2 2 3 2

output:

3 2 2 2 
2 2 3 3 
2 3 2 2 

result:

ok 

Test #57:

score: 15
Accepted
time: 7ms
memory: 19080kb

input:

2450 4 2450
540 475 1156 2334
2421 2439 1328 750
471 1051 2007 1792
1776 786 705 2269
1277 755 1674 1622
590 1378 1217 603
967 239 1658 1920
857 2307 1589 78
2172 861 2322 1634
2077 2021 1381 2179
1126 345 1547 2126
994 1214 1477 412
1857 2085 831 978
281 1844 2406 2174
521 2334 2254 1779
1508 905 1...

output:

475 1156 2334 540 
2439 2421 750 1328 
1792 471 1051 2007 
705 2269 786 1776 
1622 755 1277 1674 
590 603 1378 1217 
239 1920 967 1658 
2307 78 1589 857 
861 1634 2322 2172 
2077 2021 1381 2179 
1547 1126 345 2126 
1214 412 1477 994 
1857 2085 978 831 
281 2406 1844 2174 
521 2334 2254 1779 
1508 28...

result:

ok 

Test #58:

score: 15
Accepted
time: 7ms
memory: 18892kb

input:

2499 4 2499
1 2 2 3
1429 1 1 1429
3 4 4 7
1430 3 3 1430
5 6 6 1
1431 5 5 1431
7 8 8 11
1432 7 7 1432
9 10 10 5
1433 9 9 1433
11 12 12 15
1434 11 11 1434
13 14 14 9
1435 13 13 1435
15 16 16 19
1436 15 15 1436
17 18 18 13
1437 17 17 1437
19 20 20 23
1438 19 19 1438
21 22 22 17
1439 21 21 1439
23 24 24...

output:

1 3 2 2 
1429 1 1429 1 
3 7 4 4 
1430 1430 3 3 
5 6 1 6 
1431 1431 5 5 
7 11 8 8 
1432 1432 7 7 
9 5 10 10 
1433 9 1433 9 
11 15 12 12 
1434 1434 11 11 
13 14 9 14 
1435 1435 13 13 
15 19 16 16 
1436 1436 15 15 
17 13 18 18 
1437 17 1437 17 
19 23 20 20 
1438 1438 19 19 
21 22 17 22 
1439 1439 21 21...

result:

ok 

Test #59:

score: 15
Accepted
time: 13ms
memory: 27744kb

input:

5000 2 5000
3581 2773
462 1582
1171 208
74 4865
1018 10
1962 2532
578 1491
1140 4567
3640 4785
1051 3325
4545 2135
1152 286
309 4874
1953 3646
1794 234
1223 3529
3751 1002
3427 4740
4638 2554
933 1988
3177 1846
2440 2671
1315 3502
1382 2669
3145 443
438 2418
420 1154
671 3875
3152 1807
3618 1093
359...

output:

3581 2773 
1582 462 
208 1171 
74 4865 
1018 10 
1962 2532 
578 1491 
4567 1140 
3640 4785 
1051 3325 
4545 2135 
286 1152 
4874 309 
1953 3646 
1794 234 
1223 3529 
1002 3751 
3427 4740 
2554 4638 
1988 933 
1846 3177 
2440 2671 
3502 1315 
2669 1382 
3145 443 
2418 438 
1154 420 
671 3875 
1807 31...

result:

ok 

Test #60:

score: 15
Accepted
time: 7ms
memory: 19396kb

input:

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

output:

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

result:

ok 

Test #61:

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

input:

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

output:

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

result:

ok 

Test #62:

score: 15
Accepted
time: 10ms
memory: 18508kb

input:

156 64 156
29 104 122 93 114 102 62 151 145 125 155 109 97 116 62 72 83 122 60 109 125 19 14 101 80 125 76 155 123 128 123 57 7 154 36 60 123 36 19 89 12 3 29 36 145 66 9 13 132 26 97 89 4 95 92 19 86 140 33 89 55 5 102 119
148 71 119 10 75 47 27 30 4 109 92 63 55 28 2 156 3 123 84 10 60 13 5 93 125...

output:

66 132 102 72 83 154 151 140 155 5 145 155 7 14 145 9 116 26 114 12 4 128 102 119 19 125 123 123 19 19 125 125 57 80 104 55 33 122 101 122 93 92 97 97 86 76 62 95 3 13 36 123 89 89 109 109 89 36 36 29 62 29 60 60 
148 71 154 63 127 61 25 78 25 71 127 122 78 10 10 5 125 113 125 150 123 123 119 123 15...

result:

ok 

Test #63:

score: 15
Accepted
time: 5ms
memory: 18656kb

input:

9 1024 9
1 6 8 8 4 1 1 5 8 6 8 4 6 6 1 6 6 1 4 4 5 1 6 6 8 6 4 1 1 1 5 8 6 4 1 6 4 8 6 4 1 1 8 1 6 6 8 1 8 8 1 4 1 8 6 5 1 1 6 8 6 4 4 5 1 5 1 8 6 8 8 1 8 5 5 6 1 8 4 6 8 1 1 8 8 1 4 8 6 4 4 8 1 8 1 8 1 1 1 1 8 8 6 4 6 1 1 5 8 4 1 6 5 8 1 6 1 6 4 1 6 5 4 8 4 5 4 6 1 8 6 8 1 4 1 8 6 1 4 1 4 1 5 8 8 1...

output:

5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 4 4 5 5 5 5 5 5 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 ...

result:

ok 

Test #64:

score: 15
Accepted
time: 7ms
memory: 27308kb

input:

2462 4 2401
595 1986 967 1326
19 173 880 2187
961 1645 843 1179
177 1102 1566 1225
1065 1553 961 354
1276 625 611 1814
1110 1097 572 845
780 2178 2041 1291
1531 415 1138 2390
1131 1649 499 584
752 1296 754 1982
2295 498 1627 1853
1647 1628 974 1282
265 2321 1271 2097
1161 123 2252 1776
439 723 487 4...

output:

1326 595 1986 967 
19 173 2187 880 
843 961 1179 1645 
1225 177 1102 1566 
961 354 1065 1553 
1814 625 611 1276 
572 1110 1097 845 
780 2178 1291 2041 
1138 1531 415 2390 
499 1649 1131 584 
752 754 1982 1296 
2295 498 1853 1627 
1628 1647 974 1282 
2097 265 1271 2321 
1161 2252 1776 123 
439 723 48...

result:

ok 

Test #65:

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

input:

4990 2 3
1 2
2 2
1 2
2 2
2 1
1 1
1 2
2 1
2 1
1 1
2 2
1 1
2 2
2 2
2 2
1 2
1 1
2 1
2 1
1 1
2 1
1 1
2 2
1 2
2 1
2 2
1 1
2 2
1 1
1 2
2 2
1 2
1 1
2 1
1 1
2 2
1 2
2 1
2 1
2 2
2 1
2 2
1 1
2 1
1 2
1 2
2 1
1 2
1 2
1 1
2 2
1 2
2 1
1 1
2 2
1 2
1 2
2 2
2 2
1 2
2 1
1 2
1 1
1 1
2 1
1 1
1 2
1 2
2 1
1 2
2 2
1 2
2 2...

output:

1 2 
2 2 
2 1 
2 2 
2 1 
1 1 
1 2 
1 2 
2 1 
1 1 
2 2 
1 1 
2 2 
2 2 
2 2 
2 1 
1 1 
1 2 
2 1 
1 1 
1 2 
1 1 
2 2 
1 2 
2 1 
2 2 
1 1 
2 2 
1 1 
1 2 
2 2 
2 1 
1 1 
1 2 
1 1 
2 2 
2 1 
1 2 
2 1 
2 2 
1 2 
2 2 
1 1 
2 1 
1 2 
2 1 
1 2 
2 1 
1 2 
1 1 
2 2 
2 1 
1 2 
1 1 
2 2 
2 1 
1 2 
2 2 
2 2 
2 1 
...

result:

ok 

Test #66:

score: 15
Accepted
time: 13ms
memory: 27620kb

input:

5000 2 5000
2970 2674
1208 2674
4977 2674
2674 3028
2674 36
1712 2674
3561 2674
2674 3033
4699 2674
2674 1785
2674 4345
2674 3302
2493 2674
2674 4280
2674 3999
4850 2674
2674 4508
3742 2674
2674 2718
2674 3461
260 2674
2674 4223
2069 2674
2674 1144
1975 2674
527 2674
2674 3260
2806 2674
3636 2674
26...

output:

2970 2674 
2674 1208 
4977 2674 
2674 3028 
36 2674 
2674 1712 
2674 3561 
3033 2674 
4699 2674 
2674 1785 
2674 4345 
3302 2674 
2493 2674 
2674 4280 
3999 2674 
2674 4850 
4508 2674 
2674 3742 
2674 2718 
3461 2674 
260 2674 
2674 4223 
2674 2069 
1144 2674 
2674 1975 
527 2674 
3260 2674 
2674 28...

result:

ok 

Test #67:

score: 15
Accepted
time: 14ms
memory: 19008kb

input:

2450 4 2401
317 417 657 793
1237 1460 1990 507
1030 1744 1155 1114
486 868 1284 2376
2391 704 1441 665
173 1283 789 1607
1309 1045 1466 2192
734 766 284 254
1814 1752 1181 937
1459 1638 1329 2346
1155 1205 443 1744
430 1096 1050 1098
930 2224 1622 186
1772 1916 1833 2196
2066 739 114 757
1180 786 99...

output:

657 793 317 417 
507 1990 1237 1460 
1155 1114 1030 1744 
1284 868 2376 486 
704 665 1441 2391 
173 789 1607 1283 
1045 1309 1466 2192 
254 284 766 734 
1181 1752 937 1814 
1459 1329 2346 1638 
443 1744 1155 1205 
1050 1098 430 1096 
186 930 2224 1622 
1833 2196 1916 1772 
114 739 757 2066 
277 786 ...

result:

ok 

Test #68:

score: 15
Accepted
time: 9ms
memory: 18828kb

input:

1250 8 1000
580 788 926 830 833 861 67 795
768 582 227 113 421 701 823 566
188 868 745 494 910 981 644 76
572 751 409 665 210 771 875 742
131 442 387 298 3 151 455 145
550 78 74 694 250 672 85 118
857 807 977 695 431 855 944 533
523 881 432 789 742 787 649 615
159 29 942 894 619 538 114 42
834 480 6...

output:

788 926 833 795 67 830 580 861 
823 227 768 566 701 421 582 113 
868 745 981 644 76 910 494 188 
572 771 409 875 742 210 751 665 
131 3 455 151 442 298 145 387 
550 118 85 672 74 694 78 250 
855 977 857 695 944 533 807 431 
787 649 881 432 523 789 615 742 
29 159 114 942 894 619 538 42 
834 355 614 ...

result:

ok 

Test #69:

score: 15
Accepted
time: 7ms
memory: 18972kb

input:

1248 8 1248
161 598 1246 131 374 981 761 969
119 257 749 837 658 163 674 826
564 891 1166 207 863 733 802 929
233 964 311 507 202 314 77 400
376 1093 71 445 709 408 1247 388
1020 581 966 19 468 403 48 566
1201 785 822 946 479 132 730 703
349 861 731 188 37 1202 18 183
882 126 896 333 614 1226 648 52...

output:

131 161 981 1246 969 598 761 374 
119 163 257 658 674 749 826 837 
207 564 1166 802 929 863 733 891 
233 77 202 964 400 314 507 311 
71 376 388 408 445 1247 709 1093 
48 19 403 1020 566 581 468 966 
132 785 946 1201 479 703 822 730 
18 37 183 188 1202 349 731 861 
333 648 126 1226 896 614 882 523 
1...

result:

ok 

Subtask #6:

score: 5
Accepted

Dependency #5:

100%
Accepted

Test #70:

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

input:

3 4 3
2 3 2 2
2 3 3 2
2 2 3 2

output:

3 2 2 2 
2 2 3 3 
2 3 2 2 

result:

ok 

Test #71:

score: 5
Accepted
time: 11ms
memory: 18924kb

input:

2450 4 2450
540 475 1156 2334
2421 2439 1328 750
471 1051 2007 1792
1776 786 705 2269
1277 755 1674 1622
590 1378 1217 603
967 239 1658 1920
857 2307 1589 78
2172 861 2322 1634
2077 2021 1381 2179
1126 345 1547 2126
994 1214 1477 412
1857 2085 831 978
281 1844 2406 2174
521 2334 2254 1779
1508 905 1...

output:

475 1156 2334 540 
2439 2421 750 1328 
1792 471 1051 2007 
705 2269 786 1776 
1622 755 1277 1674 
590 603 1378 1217 
239 1920 967 1658 
2307 78 1589 857 
861 1634 2322 2172 
2077 2021 1381 2179 
1547 1126 345 2126 
1214 412 1477 994 
1857 2085 978 831 
281 2406 1844 2174 
521 2334 2254 1779 
1508 28...

result:

ok 

Test #72:

score: 5
Accepted
time: 3ms
memory: 18924kb

input:

2499 4 2499
1 2 2 3
1429 1 1 1429
3 4 4 7
1430 3 3 1430
5 6 6 1
1431 5 5 1431
7 8 8 11
1432 7 7 1432
9 10 10 5
1433 9 9 1433
11 12 12 15
1434 11 11 1434
13 14 14 9
1435 13 13 1435
15 16 16 19
1436 15 15 1436
17 18 18 13
1437 17 17 1437
19 20 20 23
1438 19 19 1438
21 22 22 17
1439 21 21 1439
23 24 24...

output:

1 3 2 2 
1429 1 1429 1 
3 7 4 4 
1430 1430 3 3 
5 6 1 6 
1431 1431 5 5 
7 11 8 8 
1432 1432 7 7 
9 5 10 10 
1433 9 1433 9 
11 15 12 12 
1434 1434 11 11 
13 14 9 14 
1435 1435 13 13 
15 19 16 16 
1436 1436 15 15 
17 13 18 18 
1437 17 1437 17 
19 23 20 20 
1438 1438 19 19 
21 22 17 22 
1439 1439 21 21...

result:

ok 

Test #73:

score: 5
Accepted
time: 7ms
memory: 19460kb

input:

5000 2 5000
3581 2773
462 1582
1171 208
74 4865
1018 10
1962 2532
578 1491
1140 4567
3640 4785
1051 3325
4545 2135
1152 286
309 4874
1953 3646
1794 234
1223 3529
3751 1002
3427 4740
4638 2554
933 1988
3177 1846
2440 2671
1315 3502
1382 2669
3145 443
438 2418
420 1154
671 3875
3152 1807
3618 1093
359...

output:

3581 2773 
1582 462 
208 1171 
74 4865 
1018 10 
1962 2532 
578 1491 
4567 1140 
3640 4785 
1051 3325 
4545 2135 
286 1152 
4874 309 
1953 3646 
1794 234 
1223 3529 
1002 3751 
3427 4740 
2554 4638 
1988 933 
1846 3177 
2440 2671 
3502 1315 
2669 1382 
3145 443 
2418 438 
1154 420 
671 3875 
1807 31...

result:

ok 

Test #74:

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

input:

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

output:

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

result:

ok 

Test #75:

score: 5
Accepted
time: 3ms
memory: 19400kb

input:

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

output:

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

result:

ok 

Test #76:

score: 5
Accepted
time: 16ms
memory: 18624kb

input:

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

output:

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

result:

ok 

Test #77:

score: 5
Accepted
time: 13ms
memory: 19192kb

input:

2500 4 2500
648 780 1555 2479
544 2007 2025 186
2208 783 346 2150
462 975 240 1243
1693 1777 2390 522
1126 1859 505 1731
991 684 1608 751
1605 129 1236 1271
121 1073 2079 409
882 1636 2432 2416
2125 1519 1046 79
315 1906 679 2452
86 669 2191 1467
326 397 286 1986
1299 2409 2259 2166
854 1437 620 330...

output:

648 1555 780 2479 
186 2007 2025 544 
783 346 2208 2150 
240 1243 975 462 
2390 1693 522 1777 
1731 1859 1126 505 
684 751 991 1608 
1605 129 1236 1271 
409 121 1073 2079 
882 2432 1636 2416 
2125 79 1046 1519 
1906 2452 679 315 
86 669 1467 2191 
397 286 326 1986 
1299 2409 2166 2259 
330 854 620 1...

result:

ok 

Test #78:

score: 5
Accepted
time: 11ms
memory: 18996kb

input:

1250 8 1250
1143 47 853 56 15 316 165 820
768 1167 447 1006 696 621 491 431
301 1068 674 1050 1107 235 256 499
702 264 364 1158 959 489 450 966
972 83 910 399 944 744 202 196
433 893 553 1010 13 847 917 296
199 788 380 1018 442 1066 1064 1059
1206 686 399 975 298 730 439 781
964 398 283 449 241 788 ...

output:

15 56 47 316 165 1143 853 820 
768 431 1167 696 621 1006 447 491 
1107 301 499 1068 235 674 1050 256 
959 702 450 264 966 489 364 1158 
944 202 972 196 399 83 744 910 
553 296 433 1010 893 847 917 13 
442 199 380 1064 1059 1066 788 1018 
439 298 399 1206 686 975 730 781 
788 964 398 449 337 788 283 ...

result:

ok 

Test #79:

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

input:

2500 4 2500
11 34 1064 1548
2120 1668 2 1223
1208 390 12 1204
482 830 1427 2204
312 1940 1551 1432
2282 1122 2271 1334
1702 344 623 224
258 20 288 1335
262 308 1502 992
474 345 2403 2254
1466 930 1281 1642
2151 434 786 1345
64 464 2265 51
2054 274 435 2007
171 867 395 544
1766 358 872 1478
345 474 2...

output:

1548 11 1064 34 
1668 2120 1223 2 
1204 12 390 1208 
830 482 2204 1427 
312 1940 1432 1551 
2271 2282 1122 1334 
344 224 1702 623 
288 258 20 1335 
308 262 1502 992 
345 2403 2254 474 
1642 930 1466 1281 
2151 786 1345 434 
464 2265 51 64 
435 2054 2007 274 
867 171 395 544 
1766 358 1478 872 
2403 ...

result:

ok 

Test #80:

score: 5
Accepted
time: 10ms
memory: 18516kb

input:

156 64 156
29 104 122 93 114 102 62 151 145 125 155 109 97 116 62 72 83 122 60 109 125 19 14 101 80 125 76 155 123 128 123 57 7 154 36 60 123 36 19 89 12 3 29 36 145 66 9 13 132 26 97 89 4 95 92 19 86 140 33 89 55 5 102 119
148 71 119 10 75 47 27 30 4 109 92 63 55 28 2 156 3 123 84 10 60 13 5 93 125...

output:

66 132 102 72 83 154 151 140 155 5 145 155 7 14 145 9 116 26 114 12 4 128 102 119 19 125 123 123 19 19 125 125 57 80 104 55 33 122 101 122 93 92 97 97 86 76 62 95 3 13 36 123 89 89 109 109 89 36 36 29 62 29 60 60 
148 71 154 63 127 61 25 78 25 71 127 122 78 10 10 5 125 113 125 150 123 123 119 123 15...

result:

ok 

Test #81:

score: 5
Accepted
time: 3ms
memory: 26772kb

input:

9 1024 9
1 6 8 8 4 1 1 5 8 6 8 4 6 6 1 6 6 1 4 4 5 1 6 6 8 6 4 1 1 1 5 8 6 4 1 6 4 8 6 4 1 1 8 1 6 6 8 1 8 8 1 4 1 8 6 5 1 1 6 8 6 4 4 5 1 5 1 8 6 8 8 1 8 5 5 6 1 8 4 6 8 1 1 8 8 1 4 8 6 4 4 8 1 8 1 8 1 1 1 1 8 8 6 4 6 1 1 5 8 4 1 6 5 8 1 6 1 6 4 1 6 5 4 8 4 5 4 6 1 8 6 8 1 4 1 8 6 1 4 1 4 1 5 8 8 1...

output:

5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 4 4 5 5 5 5 5 5 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 ...

result:

ok 

Test #82:

score: 5
Accepted
time: 5ms
memory: 27468kb

input:

2462 4 2401
595 1986 967 1326
19 173 880 2187
961 1645 843 1179
177 1102 1566 1225
1065 1553 961 354
1276 625 611 1814
1110 1097 572 845
780 2178 2041 1291
1531 415 1138 2390
1131 1649 499 584
752 1296 754 1982
2295 498 1627 1853
1647 1628 974 1282
265 2321 1271 2097
1161 123 2252 1776
439 723 487 4...

output:

1326 595 1986 967 
19 173 2187 880 
843 961 1179 1645 
1225 177 1102 1566 
961 354 1065 1553 
1814 625 611 1276 
572 1110 1097 845 
780 2178 1291 2041 
1138 1531 415 2390 
499 1649 1131 584 
752 754 1982 1296 
2295 498 1853 1627 
1628 1647 974 1282 
2097 265 1271 2321 
1161 2252 1776 123 
439 723 48...

result:

ok 

Test #83:

score: 5
Accepted
time: 3ms
memory: 19456kb

input:

4990 2 3
1 2
2 2
1 2
2 2
2 1
1 1
1 2
2 1
2 1
1 1
2 2
1 1
2 2
2 2
2 2
1 2
1 1
2 1
2 1
1 1
2 1
1 1
2 2
1 2
2 1
2 2
1 1
2 2
1 1
1 2
2 2
1 2
1 1
2 1
1 1
2 2
1 2
2 1
2 1
2 2
2 1
2 2
1 1
2 1
1 2
1 2
2 1
1 2
1 2
1 1
2 2
1 2
2 1
1 1
2 2
1 2
1 2
2 2
2 2
1 2
2 1
1 2
1 1
1 1
2 1
1 1
1 2
1 2
2 1
1 2
2 2
1 2
2 2...

output:

1 2 
2 2 
2 1 
2 2 
2 1 
1 1 
1 2 
1 2 
2 1 
1 1 
2 2 
1 1 
2 2 
2 2 
2 2 
2 1 
1 1 
1 2 
2 1 
1 1 
1 2 
1 1 
2 2 
1 2 
2 1 
2 2 
1 1 
2 2 
1 1 
1 2 
2 2 
2 1 
1 1 
1 2 
1 1 
2 2 
2 1 
1 2 
2 1 
2 2 
1 2 
2 2 
1 1 
2 1 
1 2 
2 1 
1 2 
2 1 
1 2 
1 1 
2 2 
2 1 
1 2 
1 1 
2 2 
2 1 
1 2 
2 2 
2 2 
2 1 
...

result:

ok 

Test #84:

score: 5
Accepted
time: 13ms
memory: 19312kb

input:

5000 2 5000
2970 2674
1208 2674
4977 2674
2674 3028
2674 36
1712 2674
3561 2674
2674 3033
4699 2674
2674 1785
2674 4345
2674 3302
2493 2674
2674 4280
2674 3999
4850 2674
2674 4508
3742 2674
2674 2718
2674 3461
260 2674
2674 4223
2069 2674
2674 1144
1975 2674
527 2674
2674 3260
2806 2674
3636 2674
26...

output:

2970 2674 
2674 1208 
4977 2674 
2674 3028 
36 2674 
2674 1712 
2674 3561 
3033 2674 
4699 2674 
2674 1785 
2674 4345 
3302 2674 
2493 2674 
2674 4280 
3999 2674 
2674 4850 
4508 2674 
2674 3742 
2674 2718 
3461 2674 
260 2674 
2674 4223 
2674 2069 
1144 2674 
2674 1975 
527 2674 
3260 2674 
2674 28...

result:

ok 

Test #85:

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

input:

2450 4 2401
317 417 657 793
1237 1460 1990 507
1030 1744 1155 1114
486 868 1284 2376
2391 704 1441 665
173 1283 789 1607
1309 1045 1466 2192
734 766 284 254
1814 1752 1181 937
1459 1638 1329 2346
1155 1205 443 1744
430 1096 1050 1098
930 2224 1622 186
1772 1916 1833 2196
2066 739 114 757
1180 786 99...

output:

657 793 317 417 
507 1990 1237 1460 
1155 1114 1030 1744 
1284 868 2376 486 
704 665 1441 2391 
173 789 1607 1283 
1045 1309 1466 2192 
254 284 766 734 
1181 1752 937 1814 
1459 1329 2346 1638 
443 1744 1155 1205 
1050 1098 430 1096 
186 930 2224 1622 
1833 2196 1916 1772 
114 739 757 2066 
277 786 ...

result:

ok 

Test #86:

score: 5
Accepted
time: 14ms
memory: 18980kb

input:

1250 8 1000
580 788 926 830 833 861 67 795
768 582 227 113 421 701 823 566
188 868 745 494 910 981 644 76
572 751 409 665 210 771 875 742
131 442 387 298 3 151 455 145
550 78 74 694 250 672 85 118
857 807 977 695 431 855 944 533
523 881 432 789 742 787 649 615
159 29 942 894 619 538 114 42
834 480 6...

output:

788 926 833 795 67 830 580 861 
823 227 768 566 701 421 582 113 
868 745 981 644 76 910 494 188 
572 771 409 875 742 210 751 665 
131 3 455 151 442 298 145 387 
550 118 85 672 74 694 78 250 
855 977 857 695 944 533 807 431 
787 649 881 432 523 789 615 742 
29 159 114 942 894 619 538 42 
834 355 614 ...

result:

ok 

Test #87:

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

input:

1248 8 1248
161 598 1246 131 374 981 761 969
119 257 749 837 658 163 674 826
564 891 1166 207 863 733 802 929
233 964 311 507 202 314 77 400
376 1093 71 445 709 408 1247 388
1020 581 966 19 468 403 48 566
1201 785 822 946 479 132 730 703
349 861 731 188 37 1202 18 183
882 126 896 333 614 1226 648 52...

output:

131 161 981 1246 969 598 761 374 
119 163 257 658 674 749 826 837 
207 564 1166 802 929 863 733 891 
233 77 202 964 400 314 507 311 
71 376 388 408 445 1247 709 1093 
48 19 403 1020 566 581 468 966 
132 785 946 1201 479 703 822 730 
18 37 183 188 1202 349 731 861 
333 648 126 1226 896 614 882 523 
1...

result:

ok 

Subtask #7:

score: 5
Accepted

Dependency #6:

100%
Accepted

Test #88:

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

input:

3 4 3
2 3 2 2
2 3 3 2
2 2 3 2

output:

3 2 2 2 
2 2 3 3 
2 3 2 2 

result:

ok 

Test #89:

score: 5
Accepted
time: 11ms
memory: 18848kb

input:

2450 4 2450
540 475 1156 2334
2421 2439 1328 750
471 1051 2007 1792
1776 786 705 2269
1277 755 1674 1622
590 1378 1217 603
967 239 1658 1920
857 2307 1589 78
2172 861 2322 1634
2077 2021 1381 2179
1126 345 1547 2126
994 1214 1477 412
1857 2085 831 978
281 1844 2406 2174
521 2334 2254 1779
1508 905 1...

output:

475 1156 2334 540 
2439 2421 750 1328 
1792 471 1051 2007 
705 2269 786 1776 
1622 755 1277 1674 
590 603 1378 1217 
239 1920 967 1658 
2307 78 1589 857 
861 1634 2322 2172 
2077 2021 1381 2179 
1547 1126 345 2126 
1214 412 1477 994 
1857 2085 978 831 
281 2406 1844 2174 
521 2334 2254 1779 
1508 28...

result:

ok 

Test #90:

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

input:

2499 4 2499
1 2 2 3
1429 1 1 1429
3 4 4 7
1430 3 3 1430
5 6 6 1
1431 5 5 1431
7 8 8 11
1432 7 7 1432
9 10 10 5
1433 9 9 1433
11 12 12 15
1434 11 11 1434
13 14 14 9
1435 13 13 1435
15 16 16 19
1436 15 15 1436
17 18 18 13
1437 17 17 1437
19 20 20 23
1438 19 19 1438
21 22 22 17
1439 21 21 1439
23 24 24...

output:

1 3 2 2 
1429 1 1429 1 
3 7 4 4 
1430 1430 3 3 
5 6 1 6 
1431 1431 5 5 
7 11 8 8 
1432 1432 7 7 
9 5 10 10 
1433 9 1433 9 
11 15 12 12 
1434 1434 11 11 
13 14 9 14 
1435 1435 13 13 
15 19 16 16 
1436 1436 15 15 
17 13 18 18 
1437 17 1437 17 
19 23 20 20 
1438 1438 19 19 
21 22 17 22 
1439 1439 21 21...

result:

ok 

Test #91:

score: 5
Accepted
time: 15ms
memory: 19404kb

input:

5000 2 5000
3581 2773
462 1582
1171 208
74 4865
1018 10
1962 2532
578 1491
1140 4567
3640 4785
1051 3325
4545 2135
1152 286
309 4874
1953 3646
1794 234
1223 3529
3751 1002
3427 4740
4638 2554
933 1988
3177 1846
2440 2671
1315 3502
1382 2669
3145 443
438 2418
420 1154
671 3875
3152 1807
3618 1093
359...

output:

3581 2773 
1582 462 
208 1171 
74 4865 
1018 10 
1962 2532 
578 1491 
4567 1140 
3640 4785 
1051 3325 
4545 2135 
286 1152 
4874 309 
1953 3646 
1794 234 
1223 3529 
1002 3751 
3427 4740 
2554 4638 
1988 933 
1846 3177 
2440 2671 
3502 1315 
2669 1382 
3145 443 
2418 438 
1154 420 
671 3875 
1807 31...

result:

ok 

Test #92:

score: 5
Accepted
time: 3ms
memory: 19712kb

input:

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

output:

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

result:

ok 

Test #93:

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

input:

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

output:

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

result:

ok 

Test #94:

score: 5
Accepted
time: 14ms
memory: 26792kb

input:

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

output:

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

result:

ok 

Test #95:

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

input:

2500 4 2500
648 780 1555 2479
544 2007 2025 186
2208 783 346 2150
462 975 240 1243
1693 1777 2390 522
1126 1859 505 1731
991 684 1608 751
1605 129 1236 1271
121 1073 2079 409
882 1636 2432 2416
2125 1519 1046 79
315 1906 679 2452
86 669 2191 1467
326 397 286 1986
1299 2409 2259 2166
854 1437 620 330...

output:

648 1555 780 2479 
186 2007 2025 544 
783 346 2208 2150 
240 1243 975 462 
2390 1693 522 1777 
1731 1859 1126 505 
684 751 991 1608 
1605 129 1236 1271 
409 121 1073 2079 
882 2432 1636 2416 
2125 79 1046 1519 
1906 2452 679 315 
86 669 1467 2191 
397 286 326 1986 
1299 2409 2166 2259 
330 854 620 1...

result:

ok 

Test #96:

score: 5
Accepted
time: 11ms
memory: 19068kb

input:

1250 8 1250
1143 47 853 56 15 316 165 820
768 1167 447 1006 696 621 491 431
301 1068 674 1050 1107 235 256 499
702 264 364 1158 959 489 450 966
972 83 910 399 944 744 202 196
433 893 553 1010 13 847 917 296
199 788 380 1018 442 1066 1064 1059
1206 686 399 975 298 730 439 781
964 398 283 449 241 788 ...

output:

15 56 47 316 165 1143 853 820 
768 431 1167 696 621 1006 447 491 
1107 301 499 1068 235 674 1050 256 
959 702 450 264 966 489 364 1158 
944 202 972 196 399 83 744 910 
553 296 433 1010 893 847 917 13 
442 199 380 1064 1059 1066 788 1018 
439 298 399 1206 686 975 730 781 
788 964 398 449 337 788 283 ...

result:

ok 

Test #97:

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

input:

2500 4 2500
11 34 1064 1548
2120 1668 2 1223
1208 390 12 1204
482 830 1427 2204
312 1940 1551 1432
2282 1122 2271 1334
1702 344 623 224
258 20 288 1335
262 308 1502 992
474 345 2403 2254
1466 930 1281 1642
2151 434 786 1345
64 464 2265 51
2054 274 435 2007
171 867 395 544
1766 358 872 1478
345 474 2...

output:

1548 11 1064 34 
1668 2120 1223 2 
1204 12 390 1208 
830 482 2204 1427 
312 1940 1432 1551 
2271 2282 1122 1334 
344 224 1702 623 
288 258 20 1335 
308 262 1502 992 
345 2403 2254 474 
1642 930 1466 1281 
2151 786 1345 434 
464 2265 51 64 
435 2054 2007 274 
867 171 395 544 
1766 358 1478 872 
2403 ...

result:

ok 

Test #98:

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

input:

3 2 3
1 2
2 3
2 3

output:

1 2 
2 3 
3 2 

result:

ok 

Test #99:

score: 5
Accepted
time: 9ms
memory: 18732kb

input:

156 64 156
29 104 122 93 114 102 62 151 145 125 155 109 97 116 62 72 83 122 60 109 125 19 14 101 80 125 76 155 123 128 123 57 7 154 36 60 123 36 19 89 12 3 29 36 145 66 9 13 132 26 97 89 4 95 92 19 86 140 33 89 55 5 102 119
148 71 119 10 75 47 27 30 4 109 92 63 55 28 2 156 3 123 84 10 60 13 5 93 125...

output:

66 132 102 72 83 154 151 140 155 5 145 155 7 14 145 9 116 26 114 12 4 128 102 119 19 125 123 123 19 19 125 125 57 80 104 55 33 122 101 122 93 92 97 97 86 76 62 95 3 13 36 123 89 89 109 109 89 36 36 29 62 29 60 60 
148 71 154 63 127 61 25 78 25 71 127 122 78 10 10 5 125 113 125 150 123 123 119 123 15...

result:

ok 

Test #100:

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

input:

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

output:

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

result:

ok 

Test #101:

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

input:

20 2 12
12 11
1 9
12 12
3 4
3 9
8 3
8 11
10 9
4 3
6 7
11 6
11 3
7 10
12 10
11 10
11 11
11 2
1 12
6 12
2 7

output:

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

result:

ok 

Test #102:

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

input:

20 2 8
7 7
7 8
6 4
7 4
6 2
4 6
1 3
2 3
8 3
6 7
1 5
6 3
2 5
1 4
2 2
6 2
6 3
2 5
5 3
3 3

output:

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

result:

ok 

Test #103:

score: 5
Accepted
time: 4ms
memory: 18404kb

input:

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

output:

13 1 
14 4 
14 13 
17 1 
8 15 
5 14 
3 7 
6 20 
1 9 
11 19 
20 6 
13 11 

result:

ok 

Test #104:

score: 5
Accepted
time: 4ms
memory: 18128kb

input:

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

output:

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

result:

ok 

Test #105:

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

input:

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

output:

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

result:

ok 

Test #106:

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

input:

78 128 100000
81808 77744 77980 20344 56544 50739 70835 39983 68165 34656 3072 42835 82535 82728 67410 26960 83125 8567 68716 87268 1041 55994 57260 55232 2311 39201 31839 52222 97649 77452 99484 9817 25951 19307 89403 41701 29144 21015 97490 47889 80786 38025 80518 41671 15279 15331 14598 14750 388...

output:

6989 95586 97490 97649 99906 91469 96115 96750 99484 81808 95228 91324 82317 82728 67126 67410 93636 87268 92918 68716 89666 68165 59653 87723 83125 52222 51794 82850 55232 61419 89273 89403 75728 89129 8223 77452 77705 90218 20263 22413 52468 14750 80518 29144 30001 82535 72929 73464 9817 61232 723...

result:

ok 

Test #107:

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

input:

4 2048 95000
38783 19709 71675 15481 45011 21868 31035 86793 51119 32657 89325 16883 19411 82169 55236 12196 70200 53239 39110 1874 74802 92295 14936 39296 33336 21076 44167 41683 70853 46547 4147 92052 23634 43406 21048 62597 37396 48811 32118 56333 72463 15734 84750 74354 93564 26993 34448 9656 49...

output:

77980 77991 77839 77955 78075 78193 77998 77999 77453 77500 77240 77268 77755 77766 77546 77723 78546 78568 78488 78525 78703 78791 78579 78660 78282 78317 78224 78259 78474 78484 78376 78452 76133 76147 76055 76088 76273 76274 76197 76212 75754 75767 75539 75614 75912 75921 75824 75873 76795 76936 ...

result:

ok 

Test #108:

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

input:

1250 8 8000
1142 5185 4039 4187 6143 3133 1453 6322
2826 1179 6307 4164 4163 1381 6393 5987
165 7650 2235 6199 1828 7154 1702 6555
1924 5298 6688 3890 2158 6145 6260 1593
6582 7121 595 566 1943 1749 498 4850
1658 2980 77 1807 19 5771 1887 1851
6975 6093 5956 6901 7876 3172 4955 7840
6805 5280 991 89...

output:

6143 6322 4187 1453 3133 4039 5185 1142 
6307 5987 1179 6393 1381 4164 4163 2826 
6555 6199 2235 1702 7154 7650 1828 165 
3890 5298 1593 6145 1924 6260 6688 2158 
1749 595 7121 6582 4850 566 498 1943 
1851 2980 5771 19 1887 1658 77 1807 
7840 6901 7876 3172 4955 5956 6975 6093 
892 991 7036 6805 528...

result:

ok 

Test #109:

score: 5
Accepted
time: 10ms
memory: 21284kb

input:

1250 8 100000
33559 35032 86872 2746 93799 19407 3978 35031
45242 19554 51244 7095 76508 73954 58274 17339
33768 22747 28465 45940 68882 8649 47192 74009
85827 61438 15635 42263 10935 25322 70609 29138
89239 2604 35343 91233 24911 24596 24352 4723
61239 30122 86493 3193 95509 53433 14784 66391
97818...

output:

93799 86872 3978 35032 33559 2746 35031 19407 
7095 73954 58274 19554 51244 76508 17339 45242 
33768 47192 28465 74009 8649 22747 68882 45940 
42263 70609 61438 85827 29138 10935 25322 15635 
91233 4723 2604 89239 24352 35343 24596 24911 
86493 61239 95509 3193 30122 53433 14784 66391 
88901 51969 6...

result:

ok 

Test #110:

score: 5
Accepted
time: 7ms
memory: 26712kb

input:

9 1024 9
1 6 8 8 4 1 1 5 8 6 8 4 6 6 1 6 6 1 4 4 5 1 6 6 8 6 4 1 1 1 5 8 6 4 1 6 4 8 6 4 1 1 8 1 6 6 8 1 8 8 1 4 1 8 6 5 1 1 6 8 6 4 4 5 1 5 1 8 6 8 8 1 8 5 5 6 1 8 4 6 8 1 1 8 8 1 4 8 6 4 4 8 1 8 1 8 1 1 1 1 8 8 6 4 6 1 1 5 8 4 1 6 5 8 1 6 1 6 4 1 6 5 4 8 4 5 4 6 1 8 6 8 1 4 1 8 6 1 4 1 4 1 5 8 8 1...

output:

5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 4 4 5 5 5 5 5 5 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 ...

result:

ok 

Test #111:

score: 5
Accepted
time: 13ms
memory: 19052kb

input:

2462 4 2401
595 1986 967 1326
19 173 880 2187
961 1645 843 1179
177 1102 1566 1225
1065 1553 961 354
1276 625 611 1814
1110 1097 572 845
780 2178 2041 1291
1531 415 1138 2390
1131 1649 499 584
752 1296 754 1982
2295 498 1627 1853
1647 1628 974 1282
265 2321 1271 2097
1161 123 2252 1776
439 723 487 4...

output:

1326 595 1986 967 
19 173 2187 880 
843 961 1179 1645 
1225 177 1102 1566 
961 354 1065 1553 
1814 625 611 1276 
572 1110 1097 845 
780 2178 1291 2041 
1138 1531 415 2390 
499 1649 1131 584 
752 754 1982 1296 
2295 498 1853 1627 
1628 1647 974 1282 
2097 265 1271 2321 
1161 2252 1776 123 
439 723 48...

result:

ok 

Test #112:

score: 5
Accepted
time: 7ms
memory: 19372kb

input:

4990 2 3
1 2
2 2
1 2
2 2
2 1
1 1
1 2
2 1
2 1
1 1
2 2
1 1
2 2
2 2
2 2
1 2
1 1
2 1
2 1
1 1
2 1
1 1
2 2
1 2
2 1
2 2
1 1
2 2
1 1
1 2
2 2
1 2
1 1
2 1
1 1
2 2
1 2
2 1
2 1
2 2
2 1
2 2
1 1
2 1
1 2
1 2
2 1
1 2
1 2
1 1
2 2
1 2
2 1
1 1
2 2
1 2
1 2
2 2
2 2
1 2
2 1
1 2
1 1
1 1
2 1
1 1
1 2
1 2
2 1
1 2
2 2
1 2
2 2...

output:

1 2 
2 2 
2 1 
2 2 
2 1 
1 1 
1 2 
1 2 
2 1 
1 1 
2 2 
1 1 
2 2 
2 2 
2 2 
2 1 
1 1 
1 2 
2 1 
1 1 
1 2 
1 1 
2 2 
1 2 
2 1 
2 2 
1 1 
2 2 
1 1 
1 2 
2 2 
2 1 
1 1 
1 2 
1 1 
2 2 
2 1 
1 2 
2 1 
2 2 
1 2 
2 2 
1 1 
2 1 
1 2 
2 1 
1 2 
2 1 
1 2 
1 1 
2 2 
2 1 
1 2 
1 1 
2 2 
2 1 
1 2 
2 2 
2 2 
2 1 
...

result:

ok 

Test #113:

score: 5
Accepted
time: 17ms
memory: 19416kb

input:

5000 2 5000
2970 2674
1208 2674
4977 2674
2674 3028
2674 36
1712 2674
3561 2674
2674 3033
4699 2674
2674 1785
2674 4345
2674 3302
2493 2674
2674 4280
2674 3999
4850 2674
2674 4508
3742 2674
2674 2718
2674 3461
260 2674
2674 4223
2069 2674
2674 1144
1975 2674
527 2674
2674 3260
2806 2674
3636 2674
26...

output:

2970 2674 
2674 1208 
4977 2674 
2674 3028 
36 2674 
2674 1712 
2674 3561 
3033 2674 
4699 2674 
2674 1785 
2674 4345 
3302 2674 
2493 2674 
2674 4280 
3999 2674 
2674 4850 
4508 2674 
2674 3742 
2674 2718 
3461 2674 
260 2674 
2674 4223 
2674 2069 
1144 2674 
2674 1975 
527 2674 
3260 2674 
2674 28...

result:

ok 

Test #114:

score: 5
Accepted
time: 14ms
memory: 18912kb

input:

2450 4 2401
317 417 657 793
1237 1460 1990 507
1030 1744 1155 1114
486 868 1284 2376
2391 704 1441 665
173 1283 789 1607
1309 1045 1466 2192
734 766 284 254
1814 1752 1181 937
1459 1638 1329 2346
1155 1205 443 1744
430 1096 1050 1098
930 2224 1622 186
1772 1916 1833 2196
2066 739 114 757
1180 786 99...

output:

657 793 317 417 
507 1990 1237 1460 
1155 1114 1030 1744 
1284 868 2376 486 
704 665 1441 2391 
173 789 1607 1283 
1045 1309 1466 2192 
254 284 766 734 
1181 1752 937 1814 
1459 1329 2346 1638 
443 1744 1155 1205 
1050 1098 430 1096 
186 930 2224 1622 
1833 2196 1916 1772 
114 739 757 2066 
277 786 ...

result:

ok 

Test #115:

score: 5
Accepted
time: 9ms
memory: 18800kb

input:

1250 8 1000
580 788 926 830 833 861 67 795
768 582 227 113 421 701 823 566
188 868 745 494 910 981 644 76
572 751 409 665 210 771 875 742
131 442 387 298 3 151 455 145
550 78 74 694 250 672 85 118
857 807 977 695 431 855 944 533
523 881 432 789 742 787 649 615
159 29 942 894 619 538 114 42
834 480 6...

output:

788 926 833 795 67 830 580 861 
823 227 768 566 701 421 582 113 
868 745 981 644 76 910 494 188 
572 771 409 875 742 210 751 665 
131 3 455 151 442 298 145 387 
550 118 85 672 74 694 78 250 
855 977 857 695 944 533 807 431 
787 649 881 432 523 789 615 742 
29 159 114 942 894 619 538 42 
834 355 614 ...

result:

ok 

Test #116:

score: 5
Accepted
time: 10ms
memory: 27020kb

input:

1248 8 1248
161 598 1246 131 374 981 761 969
119 257 749 837 658 163 674 826
564 891 1166 207 863 733 802 929
233 964 311 507 202 314 77 400
376 1093 71 445 709 408 1247 388
1020 581 966 19 468 403 48 566
1201 785 822 946 479 132 730 703
349 861 731 188 37 1202 18 183
882 126 896 333 614 1226 648 52...

output:

131 161 981 1246 969 598 761 374 
119 163 257 658 674 749 826 837 
207 564 1166 802 929 863 733 891 
233 77 202 964 400 314 507 311 
71 376 388 408 445 1247 709 1093 
48 19 403 1020 566 581 468 966 
132 785 946 1201 479 703 822 730 
18 37 183 188 1202 349 731 861 
333 648 126 1226 896 614 882 523 
1...

result:

ok 

Subtask #8:

score: 0
Skipped

Dependency #2:

0%

Subtask #9:

score: 0
Skipped

Dependency #3:

0%

Subtask #10:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%