QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#284312#7942. $K$ Subsequencesucup-team123#AC ✓23ms6356kbC++14633b2023-12-16 13:12:152023-12-16 13:12:15

詳細信息

Test #1:

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

input:

5
3 2
1 -1 1
4 2
-1 1 1 -1
7 3
1 1 1 1 1 1 1
10 3
1 1 1 1 -1 -1 1 1 1 1
12 4
1 1 1 1 -1 -1 -1 -1 1 1 1 1

output:

2 2 2 
2 2 1 1 
2 3 1 2 3 1 2 
2 3 1 2 2 1 1 2 3 1 
1 2 3 4 4 3 2 1 1 2 3 4 

result:

ok Correct (5 test cases)

Test #2:

score: 0
Accepted
time: 23ms
memory: 3608kb

input:

18434
10 1
-1 1 1 -1 -1 1 -1 -1 1 1
10 2
-1 -1 -1 1 1 -1 1 1 1 1
10 2
1 -1 -1 -1 -1 1 1 -1 1 1
10 7
1 1 -1 1 -1 1 1 -1 -1 1
9 1
-1 1 -1 1 1 -1 1 -1 1
8 1
-1 -1 -1 -1 1 1 -1 -1
10 3
-1 -1 -1 1 1 1 1 -1 -1 -1
9 1
1 -1 -1 1 -1 -1 -1 -1 -1
10 10
-1 1 1 1 1 1 1 1 1 1
10 4
-1 1 -1 1 -1 1 1 -1 1 1
9 3
1 1 ...

output:

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

result:

ok Correct (18434 test cases)

Test #3:

score: 0
Accepted
time: 18ms
memory: 6232kb

input:

1
199996 3
1 -1 1 1 1 1 -1 -1 -1 1 1 -1 1 -1 1 1 -1 -1 1 1 1 1 -1 1 -1 -1 -1 1 -1 1 1 1 1 1 1 1 -1 -1 -1 1 -1 -1 1 1 -1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 1 1 1 -1 1 1 1 1 1 1 1 1 -1 -1 -1 -1 1 1 -1 1 1 -1 1 -1 -1 -1 -1 -1 1 1 -1 -1 1 1 -1 1 -1 1 1 -1 1 1 1 -1 1 -1 1 1 1 -1 -1 -1 1 1 -1 -1 1 -1 -1 -1 -1 -1...

output:

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

result:

ok Correct (1 test case)

Test #4:

score: 0
Accepted
time: 18ms
memory: 6352kb

input:

1
199998 152
-1 1 -1 -1 1 -1 -1 -1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 1 -1 -1 1 1 1 -1 -1 -1 1 -1 1 -1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 1 1 -1 -1 1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 -1 1 -1 1 1 1 1 -1 1 1 1 -1 -1 1 -1 -1 1 1 -1 -1 -1 -1 1 -1 -1 1 -1 1 1 -1 1 1 -1 -1 1 -1 -1 1 -1 1 -1 1 1 -1...

output:

118 118 118 117 117 117 116 115 114 113 112 112 112 111 111 111 110 109 109 109 108 108 108 108 109 109 108 108 109 110 110 109 108 108 108 108 108 108 109 109 108 107 106 105 104 103 102 102 102 102 103 103 102 102 103 103 103 103 103 103 103 103 103 103 103 103 103 103 102 102 102 102 103 104 105 ...

result:

ok Correct (1 test case)

Test #5:

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

input:

1
199996 136
-1 1 1 1 1 1 -1 1 -1 -1 1 -1 1 1 -1 -1 1 1 1 1 1 -1 1 -1 -1 1 -1 1 1 -1 -1 1 -1 -1 1 -1 1 1 1 1 1 1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 1 -1 1 1 1 -1 1 1 1 1 1 -1 -1 1 -1 1 -1 -1 1 1 1 1 -1 1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 1 -1 1 1 1 1 1 -1 -1 1 1 1 1 1 1 1 1 1 1 1 -1 -1 -1 1 1 1 1 1...

output:

76 76 77 78 79 80 80 80 80 79 79 79 79 80 80 79 79 80 81 82 83 83 83 83 82 82 82 82 83 83 82 82 82 81 81 81 81 82 83 84 85 86 86 85 84 83 83 83 82 81 80 79 78 77 76 76 77 78 78 78 79 80 80 80 81 82 83 84 84 83 83 83 83 83 82 82 83 84 85 85 85 85 84 83 82 82 83 83 82 81 80 80 80 80 81 82 83 84 84 83 ...

result:

ok Correct (1 test case)

Test #6:

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

input:

1
199998 86240
1 1 -1 1 1 1 1 1 1 -1 1 1 -1 1 -1 -1 -1 1 1 1 1 1 1 1 -1 1 1 1 1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 1 1 -1 -1 -1 1 1 -1 -1 1 1 -1 1 -1 1 -1 1 -1 1 1 1 1 1 -1 1 -1 1 -1 1 -1 -1 1 1 1 -1 -1 -1 -1 -1 -1 1 1 1 1 -1 -1 -1 1 1 -1 -1 1 -1 1 1 1 -1 -1 -1 1 -1 -1 -1 -1 1 1 -1...

output:

27519 27520 27520 27520 27521 27522 27523 27524 27525 27525 27525 27526 27526 27526 27526 27525 27524 27524 27525 27526 27527 27528 27529 27530 27530 27530 27531 27532 27533 27534 27534 27534 27534 27533 27532 27531 27530 27529 27528 27527 27527 27527 27526 27526 27526 27525 27524 27523 27523 27524 ...

result:

ok Correct (1 test case)

Test #7:

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

input:

1
199998 196586
1 -1 -1 -1 1 -1 1 -1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 1 -1 1 1 1 -1 -1 -1 1 -1 -1 -1 1 1 -1 1 -1 1 -1 1 1 1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 1 1 1 1 1 -1 1 1 -1 1 1 1 1 -1 -1 -1 1 1 -1 -1 1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 -1 -1 1 -1 1 -1 1 1 -1 -1 -1 -1...

output:

3413 3413 3412 3411 3411 3411 3411 3411 3411 3411 3410 3409 3409 3409 3408 3407 3407 3407 3406 3405 3404 3403 3403 3403 3403 3404 3405 3405 3404 3403 3403 3403 3402 3401 3401 3402 3402 3402 3402 3402 3402 3402 3403 3404 3404 3403 3402 3401 3401 3401 3400 3399 3399 3399 3398 3398 3398 3397 3396 3396 ...

result:

ok Correct (1 test case)

Test #8:

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

input:

2
53064 32664
1 1 1 -1 1 1 1 -1 1 1 1 -1 -1 1 -1 -1 1 1 1 -1 -1 1 -1 1 1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 1 -1 1 -1 -1 1 -1 -1 1 1 -1 -1 -1 -1 1 1 1 -1 1 -1 -1 -1 -1 1 1 1 1 -1 1 1 -1 1 -1 1 -1 -1 1 -1 1 -1 -1 1 -1 1 1 -1 1 1 -1 -1 -1 1 1 1 1 1 -1 1 1 -1 1 1 -1 -1 -1 -1 1 1 -1 -1 -1 1 -1 1 1 -1 -1 1 1 1 ...

output:

20401 20402 20403 20403 20403 20404 20405 20405 20405 20406 20407 20407 20406 20406 20406 20405 20405 20406 20407 20407 20406 20406 20406 20406 20407 20408 20408 20407 20406 20406 20406 20405 20404 20403 20402 20402 20402 20402 20402 20401 20401 20401 20400 20400 20401 20401 20400 20399 20398 20398 ...

result:

ok Correct (2 test cases)

Test #9:

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

input:

2
86135 2
1 1 -1 -1 -1 1 1 -1 1 -1 -1 1 -1 1 -1 -1 -1 1 -1 1 1 1 1 -1 -1 1 -1 -1 1 1 1 -1 -1 1 1 -1 -1 -1 1 1 1 1 1 1 1 1 -1 -1 1 1 1 1 1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 -1 -1 -1 1 -1 -1 1 1 1 -1 1 -1 1 1 -1 1 1 1 -1 1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 1 -1 1 1 1 1 1 1 1 -1 1 -1 1 -1 1 -1 1...

output:

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

result:

ok Correct (2 test cases)

Test #10:

score: 0
Accepted
time: 14ms
memory: 5172kb

input:

2
114819 248
-1 -1 -1 -1 -1 1 -1 1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 -1 1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 1 -1 -1 1 -1 1 1 1 1 -1 -1 -1 -1 1 1 1 1 1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 1 -1 -1 -1 1 1 -1 -1 -1 1 -1 1 -1 -1 -1 1 1 -1 -1 -1 -1 1 1 1 -1 -1 -1 -1 1 -1 -1 -1 1 1 1 -1 -1 -1 -1 -1 1 -...

output:

243 242 241 240 239 239 239 239 239 238 238 238 238 239 239 239 239 238 238 238 237 237 237 237 237 237 237 236 235 234 233 232 231 230 230 230 230 230 229 229 229 229 230 231 232 232 231 230 229 229 230 231 232 233 233 232 232 232 231 230 230 230 229 228 228 228 227 227 228 228 227 226 226 227 227 ...

result:

ok Correct (2 test cases)

Test #11:

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

input:

2
51745 1
-1 1 1 -1 1 -1 -1 1 -1 1 -1 1 1 1 -1 -1 1 -1 1 1 1 1 1 -1 1 -1 -1 1 -1 -1 1 -1 1 1 -1 1 -1 1 1 -1 1 1 -1 1 1 1 -1 -1 1 -1 1 -1 -1 -1 1 -1 -1 1 1 -1 -1 1 1 -1 -1 -1 1 1 -1 1 -1 -1 1 1 1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 -1 -1 -1 -1 1 1 1 1 1 1 -1 -1 -1 -1 1 1 -1 1 1 -1 1 1 ...

output:

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

result:

ok Correct (2 test cases)

Test #12:

score: 0
Accepted
time: 17ms
memory: 6356kb

input:

2
190655 1
1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 1 1 1 -1 -1 1 1 -1 -1 -1 1 -1 -1 -1 1 1 -1 -1 1 -1 -1 1 1 1 1 1 -1 -1 1 -1 1 1 -1 1 1 -1 -1 -1 1 -1 -1 1 1 -1 -1 -1 1 1 1 -1 1 -1 -1 -1 1 1 1 -1 -1 -1 -1 -1 1 1 -1 1 -1 1 -1 1 -1 -1 -1 -1 1 1 -1 -1 -1 1 -1 -1 1 1 1 1 1 1 -1 -1 ...

output:

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

result:

ok Correct (2 test cases)

Test #13:

score: 0
Accepted
time: 18ms
memory: 5748kb

input:

3
509 3
-1 -1 1 1 -1 -1 1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 1 1 1 -1 1 -1 1 -1 -1 1 -1 1 -1 1 -1 -1 -1 1 -1 -1 -1 1 1 1 -1 -1 -1 -1 -1 1 -1 1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 -1 -1 1 -1 1 1 -1 -1 -1 1 -1 1 1 -1 -1 1 1 -1 -1 1 -1 -1 1 1 1 -1 1 -1 1 -1 -1 -1 1 1 1 -1 1 1 1 1 -1 1 -1 1 -...

output:

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

result:

ok Correct (3 test cases)

Test #14:

score: 0
Accepted
time: 17ms
memory: 4924kb

input:

4
25729 81
-1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 1 1 -1 -1 1 1 -1 1 -1 -1 1 -1 -1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 1 -1 1 1 1 1 1 1 -1 1 1 1 -1 -1 -1 1 1 1 1 1 1 1 -1 -1 -1 -1 1 -1 -1 -1 -1 1 -1 1 -1 1 1 -1 1 -1 1 1 -1 -1 1 1 1 1 1 1 -1 -1 1 1 -1 1 1 -1 -1 1 -1 1 ...

output:

52 51 50 49 49 49 48 47 46 45 44 43 42 42 42 42 42 41 40 40 40 39 39 39 39 40 41 41 40 40 41 41 41 41 40 40 40 39 38 38 38 38 38 37 36 35 34 33 33 34 34 33 33 33 33 34 35 36 37 38 38 38 39 40 40 39 38 38 39 40 41 42 43 44 44 43 42 41 41 41 40 39 38 38 38 38 38 38 39 39 39 39 39 40 40 39 39 40 41 42 ...

result:

ok Correct (4 test cases)

Test #15:

score: 0
Accepted
time: 18ms
memory: 4596kb

input:

5
7824 2
-1 -1 -1 -1 1 1 1 1 -1 1 1 1 -1 1 -1 -1 1 1 -1 -1 -1 1 -1 1 -1 1 -1 1 1 -1 1 1 1 1 -1 1 1 -1 1 1 1 -1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 1 1 1 1 -1 1 -1 -1 1 -1 1 -1 1 -1 1 -1 -1 1 1 -1 1 -1 1 -1 1 1 1 1 -1 1 -1 -1 -1 -1 -1 1 1 -1 1 -1 1 -1 1 1 1 -1 -1...

output:

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

result:

ok Correct (5 test cases)

Test #16:

score: 0
Accepted
time: 18ms
memory: 4492kb

input:

6
7149 4795
-1 -1 1 -1 -1 1 1 -1 1 1 1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 1 1 1 1 -1 1 -1 1 1 1 -1 -1 1 -1 1 1 1 -1 1 1 1 1 -1 1 -1 1 -1 1 -1 1 1 1 1 1 1 1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 1 1 -1 -1 -1 -1 1 1 1 -1 1 1 -1 1 -1 1 -1 1 1 -1 1 -1 -1 -1 1 1 1 1 1 1 -1 -1 -1...

output:

2354 2353 2353 2353 2352 2352 2353 2353 2353 2354 2355 2356 2356 2356 2356 2355 2354 2353 2352 2351 2350 2350 2350 2349 2349 2349 2348 2348 2348 2347 2346 2345 2345 2346 2347 2348 2348 2348 2348 2348 2349 2350 2350 2349 2349 2349 2349 2350 2351 2351 2351 2352 2353 2354 2354 2354 2354 2354 2354 2354 ...

result:

ok Correct (6 test cases)

Test #17:

score: 0
Accepted
time: 17ms
memory: 4976kb

input:

7
16819 1
1 1 1 1 1 1 -1 -1 -1 1 1 1 -1 1 1 1 -1 1 1 -1 -1 -1 1 1 1 1 -1 1 1 -1 1 -1 1 1 -1 -1 1 1 -1 1 -1 1 -1 1 1 -1 -1 1 -1 -1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 -1 1 1 -1 -1 1 -1 1 -1 1 1 -1 -1 -1 1 -1 -1 -1 -1 1 -1 1 -1 1 -1 -1 -1 1 1 1 1 1 1 -1 1 -1 1 -1 1 1 1 1 -1 -1 1 1 1 -1 1 -1 -1 1 -1 -1 1 ...

output:

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

result:

ok Correct (7 test cases)

Test #18:

score: 0
Accepted
time: 7ms
memory: 4708kb

input:

8
29021 106
-1 -1 -1 -1 1 -1 1 -1 1 -1 1 1 1 -1 -1 1 1 1 1 1 -1 -1 1 1 -1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 1 1 -1 1 1 1 -1 -1 -1 1 1 1 1 1 1 1 1 -1 1 -1 1 -1 -1 1 -1 1 -1 1 -1 1 1 -1 1 1 -1 1 -1 -1 -1 1 1 1 1 -1 -1 -1 -1 1 -1 1 -1 -1 1 1 -1 -1 -1 1 -1 1 1 -1 1 1 1 -1 1 -1 1 1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 ...

output:

83 82 81 80 80 80 80 80 80 80 80 81 82 82 81 81 82 83 84 85 85 84 84 85 85 84 83 83 84 84 83 82 81 80 79 79 80 80 80 81 82 82 81 80 80 81 82 83 84 85 86 87 87 87 87 87 87 86 86 86 86 86 86 86 86 87 87 87 88 88 88 88 87 86 86 87 88 89 89 88 87 86 86 86 86 86 85 85 86 86 85 84 84 84 84 85 85 85 86 87 ...

result:

ok Correct (8 test cases)

Test #19:

score: 0
Accepted
time: 14ms
memory: 3832kb

input:

9
37136 1
-1 1 -1 -1 -1 -1 1 -1 1 -1 -1 1 1 1 1 1 1 1 -1 1 1 -1 1 1 1 -1 -1 1 1 1 1 -1 1 -1 1 -1 -1 1 -1 1 -1 -1 -1 -1 -1 1 -1 1 -1 1 1 -1 -1 1 -1 -1 1 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 1 1 1 -1 -1 1 1 -1 1 1 1 1 1 1 -1 -1 -1 -1 -1 1 1 1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 1 1 1 1 -1 -1 1 -1 -1 1 1 1 1 -1 1 -1 ...

output:

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

result:

ok Correct (9 test cases)

Test #20:

score: 0
Accepted
time: 13ms
memory: 4672kb

input:

10
5543 1596
1 1 1 -1 1 1 1 -1 -1 -1 1 1 -1 -1 -1 1 -1 1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 1 -1 -1 -1 1 1 -1 1 -1 -1 -1 1 -1 1 1 -1 -1 1 1 1 1 1 -1 -1 1 1 -1 1 1 -1 1 -1 1 1 -1 -1 -1 1 -1 1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 -1 1 -1 1 -1 -1 1 -1 -1 -1 -1 -1 -1 1 1 1 1 -1 -1 -1 -1 1 1 1 1 -1 -1 -1 -1 1 ...

output:

756 757 758 758 758 759 760 760 759 758 758 759 759 758 757 757 757 757 757 756 756 756 755 754 753 752 751 750 750 751 751 751 751 750 749 749 750 750 750 750 749 748 748 748 748 749 749 748 748 749 750 751 752 752 751 751 752 752 752 753 753 753 753 753 754 754 753 752 752 752 752 752 751 751 751 ...

result:

ok Correct (10 test cases)

Test #21:

score: 0
Accepted
time: 17ms
memory: 3708kb

input:

100
2336 29
-1 -1 -1 1 -1 1 1 -1 -1 -1 1 -1 -1 1 1 1 1 1 1 -1 -1 1 1 -1 1 -1 -1 -1 1 -1 -1 1 1 1 1 -1 1 1 -1 1 -1 1 1 1 -1 -1 -1 -1 -1 1 1 -1 1 1 -1 -1 1 1 -1 -1 1 1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 1 1 1 1 1 -1 -1 1 -1 -1 -1 -1 -1 -1 1 -1 1 1 1 1 1 -1 1 1 1 -1 1 1 1 -1 1 -1 1 -1 1 1 1 1 1 -1 1 -1 -1 -1 ...

output:

16 15 14 14 14 14 15 15 14 13 13 13 12 12 13 14 15 16 17 17 16 16 17 17 17 17 16 15 15 15 14 14 15 16 17 17 17 18 18 18 18 18 19 20 20 19 18 17 16 16 17 17 17 18 18 17 17 18 18 17 17 18 18 17 17 17 16 15 15 15 14 13 13 14 15 16 17 17 16 16 16 15 14 13 12 11 11 11 11 12 13 14 15 15 15 16 17 17 17 18 ...

result:

ok Correct (100 test cases)

Test #22:

score: 0
Accepted
time: 17ms
memory: 3732kb

input:

101
92 1
1 1 -1 1 1 -1 -1 -1 -1 -1 1 -1 -1 1 -1 1 1 -1 1 -1 1 1 1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 1 1 -1 1 -1 -1 1 -1 -1 1 -1 -1 -1 -1 -1 1 -1 1 -1 -1 -1 -1 1 1 -1 1 1 -1 1 1 1 1 -1 -1 1 1 1 1 1 1 1 1 1 1 -1 -1
2647 2314
-1 1 -1 -1 1 1 1 -1 1 1 1 1 -1 1 -1 -1 1 -1 -1...

output:

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 
333 333 333 332 332 333 334 334 334 335 336 337 337 337 337 336 336 336 335 334 334 334 333 332 332 333 333 332 332...

result:

ok Correct (101 test cases)

Test #23:

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

input:

102
8381 7064
-1 -1 1 1 -1 -1 1 -1 1 1 1 1 1 -1 -1 1 -1 1 -1 1 1 1 -1 -1 -1 1 -1 1 1 1 1 -1 -1 -1 -1 1 1 1 -1 -1 1 1 -1 1 -1 1 -1 -1 1 -1 -1 1 -1 1 1 -1 -1 1 1 1 -1 -1 -1 1 1 1 1 1 1 -1 -1 1 -1 1 -1 -1 -1 -1 1 1 -1 1 1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 1 -1 -1 1 1 1 1 -1 -1 1 1 1 -1 1 -1 -1 -1...

output:

1317 1316 1316 1317 1317 1316 1316 1316 1316 1317 1318 1319 1320 1320 1319 1319 1319 1319 1319 1319 1320 1321 1321 1320 1319 1319 1319 1319 1320 1321 1322 1322 1321 1320 1319 1319 1320 1321 1321 1320 1320 1321 1321 1321 1321 1321 1321 1320 1320 1320 1319 1319 1319 1319 1320 1320 1319 1319 1320 1321 ...

result:

ok Correct (102 test cases)

Test #24:

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

input:

103
1976 404
1 -1 -1 1 -1 -1 -1 -1 1 1 1 -1 1 1 -1 -1 1 -1 1 -1 1 -1 -1 1 1 1 1 -1 -1 1 1 1 -1 1 -1 -1 1 -1 1 -1 1 -1 1 1 1 1 1 1 -1 -1 1 -1 -1 1 1 1 1 1 1 -1 -1 1 1 1 1 -1 -1 -1 1 -1 1 -1 1 1 1 1 -1 1 -1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 -1 -1 1 -1 1 1 -1 1 1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 1 1 1 1 -1 -...

output:

361 361 360 360 360 359 358 357 357 358 359 359 359 360 360 359 359 359 359 359 359 359 358 358 359 360 361 361 360 360 361 362 362 362 362 361 361 361 361 361 361 361 361 362 363 364 365 366 366 365 365 365 364 364 365 366 367 368 369 369 368 368 369 370 371 371 370 369 369 369 369 369 369 370 371 ...

result:

ok Correct (103 test cases)

Test #25:

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

input:

104
3135 3
1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 1 1 1 -1 -1 -1 -1 1 1 -1 1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 -1 1 1 -1 -1 1 1 -1 -1 -1 1 -1 1 1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 1 -1 1 -1 1 -1 -1 1 1 -1 -1 1 -1 -1 -1 -1 1 -1 1 1 1 1 1 1 -1 1 -1 -1 1 1 1 1 1 1 1 1 -1 -1 1 1 1 1 1 1 -1 1 1 1 1 -1 1 -1 1 1 -1...

output:

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

result:

ok Correct (104 test cases)

Test #26:

score: 0
Accepted
time: 17ms
memory: 3652kb

input:

105
1344 10
1 1 1 -1 1 -1 1 -1 -1 -1 -1 -1 1 1 1 1 1 -1 1 1 1 -1 1 -1 1 1 1 1 1 -1 -1 -1 1 1 -1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 1 1 -1 1 -1 1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 1 1 -1 1 -1 1 1 1 1 -1 1 1 1 -1 1 -1 -1 -1 1 -1 1 1 -1 1 -1 1 1 1 -1 1 -1 1 -1 -1 1 1 -1 -1 1 1 -1...

output:

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

result:

ok Correct (105 test cases)

Test #27:

score: 0
Accepted
time: 18ms
memory: 3940kb

input:

1000
1284 8
1 1 1 1 -1 1 -1 -1 -1 -1 1 1 -1 -1 1 1 1 1 -1 1 -1 1 1 -1 1 1 1 1 -1 -1 1 -1 1 -1 1 1 1 -1 1 -1 -1 1 -1 -1 -1 1 1 1 -1 -1 1 1 -1 -1 -1 -1 1 1 1 -1 1 1 -1 -1 1 -1 -1 1 1 1 1 -1 1 -1 1 1 1 -1 1 1 1 -1 1 1 -1 1 -1 1 -1 -1 -1 1 1 -1 1 1 1 1 1 -1 -1 -1 1 -1 -1 -1 1 -1 1 -1 -1 -1 -1 1 1 1 1 -1...

output:

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

result:

ok Correct (1000 test cases)

Test #28:

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

input:

1001
151 3
1 1 -1 1 -1 1 -1 1 1 -1 1 1 1 1 1 1 1 -1 1 1 -1 -1 1 1 -1 1 -1 1 -1 1 1 -1 1 1 -1 -1 1 -1 -1 1 1 -1 -1 1 -1 -1 1 1 -1 -1 -1 -1 -1 1 1 1 1 -1 -1 1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 1 1 -1 1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 -1 1 1 1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 1 -1 1 1 -1 1 1 -1 -1 -1 -1...

output:

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

result:

ok Correct (1001 test cases)

Test #29:

score: 0
Accepted
time: 18ms
memory: 3704kb

input:

1002
182 6
1 1 1 1 -1 -1 1 -1 -1 1 1 -1 1 1 -1 1 1 1 1 1 -1 -1 -1 -1 1 -1 1 1 1 -1 -1 1 1 1 1 -1 1 1 -1 -1 -1 -1 -1 1 -1 -1 1 1 -1 -1 -1 1 -1 1 -1 -1 -1 1 1 1 -1 1 1 1 1 -1 -1 -1 -1 -1 1 -1 1 -1 1 1 -1 -1 1 1 1 1 -1 1 1 -1 -1 -1 -1 1 1 1 1 1 1 1 -1 1 -1 -1 -1 1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 1 -1 1 1 1...

output:

3 4 5 6 6 5 5 5 4 4 5 5 5 6 6 6 1 2 3 4 4 3 2 1 1 1 1 2 3 3 2 2 3 4 5 5 5 6 6 5 4 3 2 2 2 1 1 2 2 1 6 6 6 6 6 5 4 4 5 6 6 6 1 2 3 3 2 1 6 5 5 5 5 5 5 6 6 5 5 6 1 2 2 2 3 3 2 1 6 6 1 2 3 4 5 6 6 6 6 5 4 4 4 3 2 1 1 2 2 1 6 5 5 5 5 6 1 2 2 2 3 4 4 4 4 3 2 1 1 1 6 5 5 5 4 4 4 3 2 2 2 1 1 1 1 2 3 4 4 3 ...

result:

ok Correct (1002 test cases)

Test #30:

score: 0
Accepted
time: 18ms
memory: 3940kb

input:

1003
95 16
1 -1 -1 1 1 1 -1 -1 -1 -1 -1 1 1 1 -1 -1 -1 -1 1 1 1 -1 1 -1 1 1 -1 -1 -1 -1 1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 -1 -1 1 -1 -1 1 -1 -1 -1 1 1 1 -1 1 1 1 -1 -1 -1 -1 1 1 -1 1 1 1 1 1 -1 -1 1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 1 -1 -1 -1 1 1 1 1 -1 -1 1 1
526 3
1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...

output:

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

result:

ok Correct (1003 test cases)

Test #31:

score: 0
Accepted
time: 14ms
memory: 3880kb

input:

1004
322 257
-1 1 1 1 1 1 1 -1 -1 1 1 -1 -1 -1 1 -1 -1 1 -1 1 -1 -1 -1 1 1 1 1 1 1 -1 1 1 -1 1 -1 1 -1 1 1 -1 1 -1 1 1 1 -1 1 1 -1 -1 1 -1 1 1 -1 -1 -1 1 -1 1 -1 1 -1 1 1 1 -1 1 1 1 -1 -1 1 1 -1 -1 -1 1 1 1 1 1 1 1 -1 -1 1 1 1 1 1 1 1 1 -1 -1 -1 1 -1 1 -1 1 1 -1 -1 -1 1 -1 1 1 1 1 -1 -1 1 -1 -1 1 -1...

output:

65 65 66 67 68 69 70 70 69 69 70 70 69 68 68 68 67 67 67 67 67 66 65 65 66 67 68 69 70 70 70 71 71 71 71 71 71 71 72 72 72 72 72 73 74 74 74 75 75 74 74 74 74 75 75 74 73 73 73 73 73 73 73 73 74 75 75 75 76 77 77 76 76 77 77 76 75 75 76 77 78 79 80 81 81 80 80 81 82 83 84 85 86 87 87 86 85 85 85 85 ...

result:

ok Correct (1004 test cases)

Test #32:

score: 0
Accepted
time: 18ms
memory: 3704kb

input:

1005
508 4
1 -1 -1 -1 1 1 1 1 1 1 1 -1 1 1 1 -1 1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 -1 1 -1 -1 1 1 -1 1 1 -1 1 -1 -1 -1 -1 1 -1 -1 1 1 1 1 -1 1 -1 1 -1 1 1 1 -1 -1 -1 -1 1 1 -1 1 -1 1 -1 1 -1 1 -1 1 1 1 -1 -1 1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 1 -1 1 -1 1 1 -1 -1 1 -1 -1 1 1 -1 -1 1 -1 -1 -1 1 1 1 -1 -1 1 1 1 ...

output:

1 1 4 3 3 4 1 2 3 4 1 1 1 2 3 3 3 3 3 3 3 4 4 4 4 3 3 3 2 2 2 1 1 2 2 2 3 3 3 3 2 1 4 4 4 3 3 4 1 2 2 2 2 2 2 2 3 4 4 3 2 1 1 2 2 2 2 2 2 2 2 2 2 2 3 4 4 3 3 3 2 1 4 4 1 1 4 3 2 2 2 2 2 2 3 3 2 2 2 1 1 2 2 1 1 1 4 3 3 4 1 1 4 4 1 2 3 4 4 4 1 2 3 4 4 4 1 2 2 1 1 1 4 3 3 4 4 4 1 2 3 3 2 1 1 1 4 3 2 1 ...

result:

ok Correct (1005 test cases)

Test #33:

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

input:

9995
9 7
-1 1 -1 -1 -1 1 -1 -1 1
1 1
-1
7 1
-1 -1 -1 -1 1 -1 -1
25 1
1 1 1 1 1 1 1 -1 -1 -1 -1 1 -1 -1 1 1 1 -1 1 -1 1 1 -1 -1 -1
24 22
1 -1 1 -1 1 -1 1 1 1 -1 1 1 1 1 -1 1 1 -1 1 -1 -1 1 -1 -1
6 3
1 -1 1 1 -1 -1
6 4
-1 1 -1 -1 -1 1
14 9
-1 -1 1 -1 1 -1 1 1 1 1 1 1 1 -1
24 3
1 -1 -1 -1 1 1 -1 1 1 1 ...

output:

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

result:

ok Correct (9995 test cases)

Test #34:

score: 0
Accepted
time: 22ms
memory: 3680kb

input:

9996
27 1
1 1 -1 -1 -1 -1 -1 -1 -1 1 1 1 -1 -1 -1 -1 1 -1 1 -1 -1 -1 1 1 -1 1 1
7 2
1 1 1 1 -1 -1 1
22 3
-1 -1 1 1 -1 -1 -1 1 1 1 -1 -1 -1 -1 -1 1 -1 1 1 -1 -1 1
37 4
-1 -1 -1 1 -1 1 -1 -1 -1 1 1 -1 1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 -1 1 1 1 1 1 1 -1 1 1 1
7 1
-1 1 -1 -1 1 1 1
29 1
-1 -1 1 -1 1 -1 1...

output:

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

result:

ok Correct (9996 test cases)

Test #35:

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

input:

9997
15 9
-1 1 1 -1 1 1 -1 1 -1 1 1 1 1 1 1
1 1
1
37 20
-1 1 -1 -1 1 -1 -1 1 -1 -1 -1 1 -1 1 1 -1 1 1 -1 -1 -1 -1 1 1 -1 1 -1 -1 -1 1 -1 1 1 1 1 1 -1
64 2
-1 -1 -1 -1 -1 1 1 1 1 1 1 1 1 -1 -1 -1 -1 -1 -1 1 1 -1 -1 -1 -1 -1 1 -1 1 -1 1 1 1 1 -1 1 -1 -1 -1 1 1 -1 -1 1 1 -1 -1 1 -1 -1 -1 -1 1 1 -1 -1 -...

output:

6 6 7 7 7 8 8 8 8 8 9 1 2 3 4 
1 
17 17 17 16 16 16 15 15 15 14 13 13 13 13 14 14 14 15 15 14 13 12 12 13 13 13 13 12 11 11 11 11 12 13 14 15 15 
2 1 2 1 2 2 1 2 1 2 1 2 1 1 2 1 2 1 2 2 1 1 2 1 2 1 1 1 1 1 1 2 1 2 2 2 2 1 2 2 1 1 2 2 1 1 2 2 2 1 2 1 1 2 2 1 2 2 2 2 2 2 2 1 
1 2 1 2 2 2 1 2 1 2 2 2 1...

result:

ok Correct (9997 test cases)

Test #36:

score: 0
Accepted
time: 17ms
memory: 3840kb

input:

9998
28 3
-1 1 1 -1 -1 -1 -1 -1 1 1 1 -1 -1 1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 1 1 1 1
12 2
-1 -1 -1 1 -1 -1 1 -1 1 1 -1 1
8 6
-1 1 1 -1 1 1 1 1
3 1
1 1 -1
12 1
1 -1 1 1 1 -1 1 -1 -1 1 1 -1
3 1
1 -1 -1
77 3
-1 -1 1 1 1 -1 1 -1 1 1 1 1 1 1 1 -1 -1 -1 1 -1 -1 1 -1 -1 1 1 -1 1 -1 1 1 -1 -1 -1 -1 -1 1 -1 1 -...

output:

1 1 2 2 1 3 2 1 1 2 3 3 2 2 2 2 2 1 3 2 1 3 2 2 3 1 2 3 
2 1 2 2 2 1 1 1 1 2 2 2 
2 2 3 3 3 4 5 6 
1 1 1 
1 1 1 1 1 1 1 1 1 1 1 1 
1 1 1 
2 1 1 2 3 3 3 3 3 1 2 3 1 2 3 3 2 1 1 1 3 3 3 2 2 3 3 3 3 3 1 1 3 2 1 3 3 3 3 3 2 1 1 1 1 1 1 1 3 3 1 2 2 1 3 3 1 2 2 2 2 2 3 1 2 2 1 1 2 2 1 3 2 2 3 3 3 
1 1 
1 ...

result:

ok Correct (9998 test cases)

Test #37:

score: 0
Accepted
time: 17ms
memory: 3592kb

input:

9999
65 2
-1 -1 1 1 -1 -1 -1 1 -1 -1 -1 1 1 -1 -1 -1 -1 1 -1 1 1 -1 -1 1 -1 1 1 1 -1 -1 1 1 1 1 -1 1 -1 1 -1 1 -1 -1 -1 1 1 -1 -1 -1 -1 1 1 1 1 -1 -1 1 -1 1 1 1 1 1 1 1 1
12 3
1 1 1 1 -1 -1 -1 -1 1 1 -1 -1
75 2
1 -1 1 -1 -1 -1 1 1 -1 1 -1 1 -1 -1 -1 1 1 1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 -1 -1 1 1 -1 1 1...

output:

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

result:

ok Correct (9999 test cases)

Test #38:

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

input:

10000
15 3
-1 1 -1 1 -1 -1 1 -1 1 -1 1 -1 -1 -1 1
3 3
-1 1 1
34 2
-1 -1 -1 -1 1 -1 1 -1 -1 -1 -1 1 -1 -1 -1 1 -1 -1 1 -1 1 -1 -1 1 -1 1 1 -1 -1 -1 1 -1 1 1
3 2
1 1 -1
25 2
-1 -1 1 1 1 -1 1 -1 1 -1 -1 -1 1 1 1 -1 1 1 1 1 -1 1 -1 1 -1
11 1
1 -1 -1 -1 -1 -1 1 -1 -1 -1 1
29 2
-1 -1 -1 1 -1 1 -1 -1 -1 -1...

output:

3 3 3 3 3 2 2 2 2 2 2 2 1 3 3 
3 3 1 
2 1 2 1 1 1 1 1 2 1 2 2 2 1 2 2 2 1 1 1 1 1 2 2 2 2 1 1 2 1 1 1 1 2 
2 1 1 
1 2 2 1 2 2 2 2 2 2 1 2 2 1 2 2 2 1 2 1 1 1 1 1 1 
1 1 1 1 1 1 1 1 1 1 1 
1 2 1 1 1 1 1 2 1 2 1 2 2 1 2 1 1 2 1 1 1 1 1 2 2 1 1 1 2 
1 1 4 4 
1 1 1 
1 1 1 
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

result:

ok Correct (10000 test cases)

Extra Test:

score: 0
Extra Test Passed