QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#106043#6373. Impress HerDitaMirikaTL 171ms6720kbC++141.2kb2023-05-16 11:13:002023-05-16 11:13:02

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 5348kb

input:

3 4
1 2 2 4
1 1 1 4
5 1 7 4

output:

3

result:

ok 1 number(s): "3"

Test #2:

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

input:

1 3
1 2 3

output:

0

result:

ok 1 number(s): "0"

Test #3:

score: 0
Accepted
time: 2ms
memory: 5356kb

input:

1 3
1 1 3

output:

0

result:

ok 1 number(s): "0"

Test #4:

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

input:

1 3
2 2 2

output:

0

result:

ok 1 number(s): "0"

Test #5:

score: 0
Accepted
time: 2ms
memory: 5504kb

input:

1 30
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

output:

0

result:

ok 1 number(s): "0"

Test #6:

score: 0
Accepted
time: 2ms
memory: 5392kb

input:

1 30
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 25 27 28 29 30

output:

0

result:

ok 1 number(s): "0"

Test #7:

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

input:

1 30
11 11 11 11 11 11 11 11 11 11 11 11 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 28 28 28

output:

0

result:

ok 1 number(s): "0"

Test #8:

score: 0
Accepted
time: 2ms
memory: 5316kb

input:

1 200
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 100 10...

output:

0

result:

ok 1 number(s): "0"

Test #9:

score: 0
Accepted
time: 2ms
memory: 5316kb

input:

1 200
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 48 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 68 70 71 72 73 74 75 76 76 78 79 80 81 83 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 10...

output:

0

result:

ok 1 number(s): "0"

Test #10:

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

input:

1 200
1 1 3 4 6 6 7 9 9 10 11 12 13 14 15 16 17 19 19 19 21 22 24 24 26 26 26 28 28 30 31 32 33 34 35 36 36 38 38 40 41 42 43 44 44 46 46 48 49 50 51 53 53 53 55 56 57 58 59 60 60 62 63 63 65 66 67 68 69 70 71 72 73 74 77 77 77 77 79 79 81 82 84 84 84 86 87 88 89 90 92 92 93 95 95 96 97 100 100 100 ...

output:

0

result:

ok 1 number(s): "0"

Test #11:

score: 0
Accepted
time: 2ms
memory: 5392kb

input:

1 200
2 2 2 2 6 6 11 11 11 11 11 11 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 33 33 33 33 33 33 33 33 33 43 43 43 43 43 43 43 43 43 43 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 71 71 71 71 71 71 71 71 71 71 71 85 85 85 85 85 85 85 85 89 89 89 92 92 92 92 92 92 92 92 92 92 ...

output:

0

result:

ok 1 number(s): "0"

Test #12:

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

input:

1 200
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 157 157 157 157 157 157 157 157 157 157 157 157 157 157 157 157 157 157 157 157 157 157 157 157 157 157 157 157 157 157 157 157 157 157 15...

output:

0

result:

ok 1 number(s): "0"

Test #13:

score: 0
Accepted
time: 2ms
memory: 5396kb

input:

1 200
136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 136 13...

output:

0

result:

ok 1 number(s): "0"

Test #14:

score: 0
Accepted
time: 2ms
memory: 5356kb

input:

1 200
48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 48 ...

output:

0

result:

ok 1 number(s): "0"

Test #15:

score: 0
Accepted
time: 2ms
memory: 5360kb

input:

1 200
137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 137 13...

output:

0

result:

ok 1 number(s): "0"

Test #16:

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

input:

1 500
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 100 10...

output:

0

result:

ok 1 number(s): "0"

Test #17:

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

input:

1 500
1 2 2 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 100 10...

output:

0

result:

ok 1 number(s): "0"

Test #18:

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

input:

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

output:

0

result:

ok 1 number(s): "0"

Test #19:

score: 0
Accepted
time: 2ms
memory: 5404kb

input:

1 500
7 7 7 7 7 7 7 9 9 9 11 11 14 14 14 17 17 19 19 19 19 22 23 23 25 26 26 28 29 32 32 32 32 32 32 32 38 38 39 44 44 44 44 44 44 44 44 44 44 44 44 52 52 55 55 55 55 58 58 62 62 62 63 64 65 67 67 67 67 67 67 67 74 74 74 74 74 74 74 74 81 83 83 83 85 86 88 88 88 88 88 88 88 88 88 96 96 96 96 96 101 ...

output:

0

result:

ok 1 number(s): "0"

Test #20:

score: 0
Accepted
time: 2ms
memory: 5400kb

input:

1 500
2 2 2 2 2 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 92 100 100 100 100 100 ...

output:

0

result:

ok 1 number(s): "0"

Test #21:

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

input:

1 500
406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 406 40...

output:

0

result:

ok 1 number(s): "0"

Test #22:

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

input:

1 500
153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 15...

output:

0

result:

ok 1 number(s): "0"

Test #23:

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

input:

1 500
444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 444 44...

output:

0

result:

ok 1 number(s): "0"

Test #24:

score: 0
Accepted
time: 2ms
memory: 5560kb

input:

3 3
1 2 3
7 5 6
7 8 9

output:

0

result:

ok 1 number(s): "0"

Test #25:

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

input:

3 3
2 2 2
4 5 6
7 7 9

output:

0

result:

ok 1 number(s): "0"

Test #26:

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

input:

3 3
5 5 5
5 5 5
5 5 5

output:

0

result:

ok 1 number(s): "0"

Test #27:

score: 0
Accepted
time: 2ms
memory: 5544kb

input:

3 30
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 52 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

output:

0

result:

ok 1 number(s): "0"

Test #28:

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

input:

3 30
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 16 18 19 20 21 22 23 24 25 26 26 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

output:

0

result:

ok 1 number(s): "0"

Test #29:

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

input:

3 30
31 38 38 38 38 38 38 38 38 38 73 73 73 73 16 16 16 16 19 85 85 85 85 85 85 85 27 85 85 30
31 32 38 38 38 38 38 38 38 40 73 73 73 73 16 16 16 48 80 85 85 85 85 85 85 85 85 85 85 60
62 62 38 38 65 38 38 38 38 70 71 73 73 73 75 76 77 78 80 80 81 82 82 84 85 85 85 89 89 89

output:

10

result:

ok 1 number(s): "10"

Test #30:

score: 0
Accepted
time: 2ms
memory: 5416kb

input:

3 200
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 52 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 10...

output:

0

result:

ok 1 number(s): "0"

Test #31:

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

input:

3 200
1 2 3 3 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 100 10...

output:

1

result:

ok 1 number(s): "1"

Test #32:

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

input:

3 200
1 2 3 4 5 6 7 8 9 10 11 11 13 14 15 17 17 18 19 20 21 22 23 24 25 26 27 28 29 230 31 32 33 33 435 436 37 38 39 40 241 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 64 66 67 68 69 70 71 72 273 74 75 76 278 78 79 80 81 82 83 84 85 86 86 88 89 90 91 92 93 94 95 96 97 98 99 ...

output:

8

result:

ok 1 number(s): "8"

Test #33:

score: 0
Accepted
time: 2ms
memory: 5456kb

input:

3 200
1 2 2 2 2 11 11 11 11 11 11 11 11 11 218 218 218 218 218 218 218 218 23 24 427 427 27 427 427 430 430 430 239 239 239 239 239 239 39 39 239 239 239 239 239 248 248 248 248 248 253 253 253 253 253 253 253 253 253 253 253 62 62 266 266 266 266 69 69 69 71 272 73 73 73 277 277 277 277 277 282 282...

output:

37

result:

ok 1 number(s): "37"

Test #34:

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

input:

3 200
284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 284 28...

output:

1

result:

ok 1 number(s): "1"

Test #35:

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

input:

3 200
500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 500 50...

output:

0

result:

ok 1 number(s): "0"

Test #36:

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

input:

3 200
430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 430 43...

output:

0

result:

ok 1 number(s): "0"

Test #37:

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

input:

3 200
376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 376 37...

output:

0

result:

ok 1 number(s): "0"

Test #38:

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

input:

3 500
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 100 10...

output:

0

result:

ok 1 number(s): "0"

Test #39:

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

input:

3 500
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 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 10...

output:

0

result:

ok 1 number(s): "0"

Test #40:

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

input:

3 500
1 2 3 4 5 6 7 8 9 10 10 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 538 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 62 64 65 66 68 68 69 70 71 72 73 574 75 76 77 78 79 80 82 82 83 84 85 86 87 88 89 89 91 92 93 94 95 96 97 99 99 100 ...

output:

2

result:

ok 1 number(s): "2"

Test #41:

score: 0
Accepted
time: 2ms
memory: 5460kb

input:

3 500
1001 2 504 4 505 6 8 8 509 10 11 13 13 514 1017 1017 17 18 19 22 22 22 23 24 28 28 28 28 29 31 31 32 534 534 534 36 37 38 38 540 41 41 543 44 45 46 47 48 49 50 52 52 53 53 53 57 57 57 59 59 61 61 563 64 66 66 1073 1073 1073 1073 1073 72 73 73 75 576 77 77 80 80 82 82 83 83 85 85 87 88 89 88 91...

output:

181

result:

ok 1 number(s): "181"

Test #42:

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

input:

3 500
1013 1013 1013 1013 1013 1013 1013 1013 1013 1013 1013 1013 1013 1013 1013 1013 1013 1013 1013 1013 1013 1013 1013 1013 1013 1013 35 35 35 35 35 35 35 35 35 35 35 35 35 35 41 35 35 35 546 546 55 55 55 55 55 55 55 55 55 55 55 55 59 562 562 562 562 568 568 568 568 68 568 568 71 71 73 575 575 85 ...

output:

84

result:

ok 1 number(s): "84"

Test #43:

score: 0
Accepted
time: 2ms
memory: 5400kb

input:

3 500
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 552 552 552 552 552 552 552 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 607 60...

output:

5

result:

ok 1 number(s): "5"

Test #44:

score: 0
Accepted
time: 2ms
memory: 5404kb

input:

3 500
297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 297 29...

output:

0

result:

ok 1 number(s): "0"

Test #45:

score: 0
Accepted
time: 2ms
memory: 5548kb

input:

3 500
1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030 1030...

output:

0

result:

ok 1 number(s): "0"

Test #46:

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

input:

500 3
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
100 10...

output:

0

result:

ok 1 number(s): "0"

Test #47:

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

input:

500 3
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
100 10...

output:

1

result:

ok 1 number(s): "1"

Test #48:

score: 0
Accepted
time: 2ms
memory: 6520kb

input:

500 3
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 51
55 56 57
58 59 60
61 62 63
64 65 66
67 68 69
70 71 72
73 74 75
73 77 78
73 80 81
82 83 84
85 86 87
88 89 90
91 92 93
94 94 96
100 94 99
100 1...

output:

3

result:

ok 1 number(s): "3"

Test #49:

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

input:

500 3
1 2 3
1 1 11
7 11 11
13 11 12
13 17 15
16 17 18
16 16 16
16 23 23
16 26 27
28 29 30
31 41 33
41 41 36
41 41 39
43 41 42
43 41 42
49 47 48
49 50 51
49 53 54
57 57 57
58 57 57
61 62 63
64 65 66
67 71 69
71 71 71
76 74 78
76 76 78
76 76 81
82 83 84
89 89 87
89 89 89
92 92 93
94 95 96
97 100 99
10...

output:

155

result:

ok 1 number(s): "155"

Test #50:

score: 0
Accepted
time: 2ms
memory: 5372kb

input:

500 3
5 5 5
5 5 5
5 5 9
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 36
5 5 5
5 5 5
5 5 5
5 5 5
49 5 51
52 5 5
5 5 5
5 5 5
5 5 63
5 5 5
68 68 68
71 71 71
71 71 71
71 71 71
71 71 71
71 71 71
71 71 71
71 71 71
173 173 173
173 173 173
173 173 173
173 173 173
103 173 173
173 173 173
173 173 173
1...

output:

82

result:

ok 1 number(s): "82"

Test #51:

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

input:

500 3
24 24 24
24 24 24
24 24 24
24 24 24
24 24 24
24 24 24
24 24 24
119 24 24
119 119 119
119 119 119
119 119 119
119 119 119
119 119 119
119 119 119
119 119 119
119 119 119
119 119 119
119 119 119
119 119 119
119 119 119
119 119 119
119 119 119
119 119 119
119 119 119
119 119 119
119 119 119
119 1...

output:

13

result:

ok 1 number(s): "13"

Test #52:

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

input:

500 3
308 308 308
308 308 308
308 308 308
308 308 308
308 308 308
308 308 308
308 308 308
308 308 308
308 308 308
308 308 308
308 308 308
308 308 308
308 308 308
308 308 308
308 308 308
308 308 308
308 308 308
308 308 308
308 308 308
308 308 308
308 308 308
308 308 308
308 308 308
308 308 308
308 30...

output:

1

result:

ok 1 number(s): "1"

Test #53:

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

input:

500 3
201 201 201
201 201 201
201 201 201
201 201 201
201 201 201
201 201 201
201 201 201
201 201 201
201 201 201
201 201 201
201 201 201
201 201 201
201 201 201
201 201 201
201 201 201
201 201 201
201 201 201
201 201 201
201 201 201
201 201 201
201 201 201
201 201 201
201 201 201
201 201 201
201 20...

output:

0

result:

ok 1 number(s): "0"

Test #54:

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

input:

500 3
359 359 359
359 359 359
359 359 359
359 359 359
359 359 359
359 359 359
359 359 359
359 359 359
359 359 359
359 359 359
359 359 359
359 359 359
359 359 359
359 359 359
359 359 359
359 359 359
359 359 359
359 359 359
359 359 359
359 359 359
359 359 359
359 359 359
359 359 359
359 359 359
359 35...

output:

0

result:

ok 1 number(s): "0"

Test #55:

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

input:

500 3
707 707 707
707 707 707
707 707 707
707 707 707
707 707 707
707 707 707
707 707 707
707 707 707
707 707 707
707 707 707
707 707 707
707 707 707
707 707 707
707 707 707
707 707 707
707 707 707
707 707 707
707 707 707
707 707 707
707 707 707
707 707 707
707 707 707
707 707 707
707 707 707
707 70...

output:

0

result:

ok 1 number(s): "0"

Test #56:

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

input:

500 3
613 613 613
613 613 613
613 613 613
613 613 613
613 613 613
613 613 613
613 613 613
613 613 613
613 613 613
613 613 613
613 613 613
613 613 613
613 613 613
613 613 613
613 613 613
613 613 613
613 613 613
613 613 613
613 613 613
613 613 613
613 613 613
613 613 613
613 613 613
613 613 613
613 61...

output:

0

result:

ok 1 number(s): "0"

Test #57:

score: 0
Accepted
time: 2ms
memory: 5676kb

input:

500 3
1052 1052 1052
1052 1052 1052
1052 1052 1052
1052 1052 1052
1052 1052 1052
1052 1052 1052
1052 1052 1052
1052 1052 1052
1052 1052 1052
1052 1052 1052
1052 1052 1052
1052 1052 1052
1052 1052 1052
1052 1052 1052
1052 1052 1052
1052 1052 1052
1052 1052 1052
1052 1052 1052
1052 1052 1052
1052 1052...

output:

0

result:

ok 1 number(s): "0"

Test #58:

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

input:

500 3
842 842 842
842 842 842
842 842 842
842 842 842
842 842 842
842 842 842
842 842 842
842 842 842
842 842 842
842 842 842
842 842 842
842 842 842
842 842 842
842 842 842
842 842 842
842 842 842
842 842 842
842 842 842
842 842 842
842 842 842
842 842 842
842 842 842
842 842 842
842 842 842
842 84...

output:

0

result:

ok 1 number(s): "0"

Test #59:

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

input:

500 3
398 398 398
398 398 398
398 398 398
398 398 398
398 398 398
398 398 398
398 398 398
398 398 398
398 398 398
398 398 398
398 398 398
398 398 398
398 398 398
398 398 398
398 398 398
398 398 398
398 398 398
398 398 398
398 398 398
398 398 398
398 398 398
398 398 398
398 398 398
398 398 398
398 39...

output:

0

result:

ok 1 number(s): "0"

Test #60:

score: 0
Accepted
time: 2ms
memory: 5952kb

input:

500 3
782 782 782
782 782 782
782 782 782
782 782 782
782 782 782
782 782 782
782 782 782
782 782 782
782 782 782
782 782 782
782 782 782
782 782 782
782 782 782
782 782 782
782 782 782
782 782 782
782 782 782
782 782 782
782 782 782
782 782 782
782 782 782
782 782 782
782 782 782
782 782 782
782 78...

output:

0

result:

ok 1 number(s): "0"

Test #61:

score: 0
Accepted
time: 138ms
memory: 6648kb

input:

500 30
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 100 1...

output:

0

result:

ok 1 number(s): "0"

Test #62:

score: 0
Accepted
time: 141ms
memory: 6720kb

input:

500 30
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 100 1...

output:

0

result:

ok 1 number(s): "0"

Test #63:

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

input:

500 30
1 1 3 4 5 6 7 38 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
31 32 34 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 100 ...

output:

0

result:

ok 1 number(s): "0"

Test #64:

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

input:

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

output:

49

result:

ok 1 number(s): "49"

Test #65:

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

input:

500 30
1 2 3 4 5 7 7 38 9 9 11 12 13 14 45 16 17 18 19 20 21 23 23 25 25 25 27 28 29 29
31 32 34 34 35 36 37 38 39 40 41 42 43 44 45 46 46 48 49 50 51 52 23 54 55 57 57 58 59 60
61 62 63 64 65 65 67 68 69 70 71 72 73 74 75 76 77 78 78 80 81 82 83 84 85 86 87 58 89 90
91 122 93 94 95 96 97 68 99 99 1...

output:

442

result:

ok 1 number(s): "442"

Test #66:

score: 0
Accepted
time: 108ms
memory: 6600kb

input:

500 30
1 2 4 4 5 6 7 8 9 10 12 12 13 14 14 46 17 18 19 50 21 22 23 54 54 26 27 28 60 60
31 32 33 34 35 66 37 8 40 40 40 42 43 44 75 46 47 48 50 50 51 52 54 54 55 56 57 58 60 60
61 62 63 64 66 66 66 68 69 70 71 72 73 74 75 76 47 78 79 80 81 82 83 54 85 86 87 88 89 90
91 92 92 94 95 96 97 98 99 102 10...

output:

1074

result:

ok 1 number(s): "1074"

Test #67:

score: 0
Accepted
time: 85ms
memory: 5876kb

input:

500 30
1 32 64 4 5 5 7 38 9 11 11 12 13 14 15 16 17 17 19 22 22 22 25 25 25 26 27 28 29 30
31 32 64 64 5 36 36 38 39 40 42 42 13 44 45 77 47 77 77 50 22 52 53 53 55 26 57 58 59 60
61 61 63 64 65 96 67 68 69 69 71 72 73 74 75 77 77 77 77 80 80 82 53 175 175 86 118 88 119 120
91 93 93 64 95 96 96 68 9...

output:

1681

result:

ok 1 number(s): "1681"

Test #68:

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

input:

500 30
32 32 3 4 5 5 5 9 9 10 11 12 13 14 45 17 17 17 19 19 21 84 23 84 26 26 27 28 29 30
32 32 32 34 5 5 5 9 9 9 41 41 43 44 45 46 17 17 17 80 51 84 84 84 26 86 58 58 29 60
32 32 32 32 5 96 157 68 68 9 71 71 73 74 74 74 17 17 79 80 84 84 84 84 85 86 86 58 58 90
151 122 93 94 156 96 157 157 99 100 1...

output:

2315

result:

ok 1 number(s): "2315"

Test #69:

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

input:

500 30
31 31 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995
31 31 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995 5995
5...

output:

406

result:

ok 1 number(s): "406"

Test #70:

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

input:

500 30
2 2 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034
7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034 7034...

output:

111

result:

ok 1 number(s): "111"

Test #71:

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

input:

500 30
9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977
9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 9977 997...

output:

13

result:

ok 1 number(s): "13"

Test #72:

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

input:

500 30
13390 13390 13390 13390 13390 13390 13390 13390 13390 13390 13390 13390 13390 13390 13390 13390 13390 13390 13390 13390 13390 22 13390 13390 13390 13390 13390 13390 13390 13390
13390 13390 13390 13390 13390 13390 13390 13390 13390 13390 13390 13390 13390 13390 13390 13390 13390 13390 13390 13...

output:

1

result:

ok 1 number(s): "1"

Test #73:

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

input:

500 30
4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124
4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 4124 412...

output:

1

result:

ok 1 number(s): "1"

Test #74:

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

input:

500 30
5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888
5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 5888 588...

output:

0

result:

ok 1 number(s): "0"

Test #75:

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

input:

500 30
2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867
2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 2867 286...

output:

0

result:

ok 1 number(s): "0"

Test #76:

score: -100
Time Limit Exceeded

input:

500 200
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 100 ...

output:


result: