QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#940090#10178. 그리드 복원chenyitaoooo 100 ✓123ms18304kbC++173.0kb2025-03-17 17:26:562025-03-17 17:27:00

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 12
Accepted

Test #1:

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

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
0...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
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:

11aafa73e7e6b339b273565a5bb47429
200
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
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

Test #2:

score: 12
Accepted
time: 1ms
memory: 3840kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
2
1 1
0 1
0 1
1 0
2
1 1
0 1
0 1
1 0
2
1 1
0 1
0 1
1 0
2
1 1
0 1
1 0
1 0
2
1 1
0 1
0 1
1 0
2
1 1
0 1
0 1
1 0
2
1 1
0 1
0 1
1 0
2
1 1
0 1
1 0
1 0
2
1 1
0 1
1 0
1 0
2
1 1
0 1
0 1
0 1
2
1 1
0 1
0 1
0 1
2
1 1
0 1
0 1
0 1
2
1 1
0 1
0 1
1 0
2
1 1
0 1
0 1
0 1
2...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
2 3
-1 1 
1 0 
1 1 
1 0 
2 3
-1 1 
1 0 
1 1 
1 0 
2 3
-1 1 
1 0 
1 1 
1 0 
2 3
1 0 
-1 1 
1 0 
1 1 
2 3
-1 1 
1 0 
1 1 
1 0 
2 3
-1 1 
1 0 
1 1 
1 0 
2 3
-1 1 
1 0 
1 1 
1 0 
2 3
1 0 
-1 1 
1 0 
1 1 
2 3
1 0 
-1 1 
1 0 
1 1 
2 3
1 -1 
0 1 
1 1 
0 1 
2 3...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
2 3
-1 1 
1 0 
1 1 
1 0 
2 3
-1 1 
1 0 
1 1 
1 0 
2 3
-1 1 
1 0 
1 1 
1 0 
2 3
1 0 
-1 1 
1 0 
1 1 
2 3
-1 1 
1 0 
1 1 
1 0 
2 3
-1 1 
1 0 
1 1 
1 0 
2 3
-1 1 
1 0 
1 1 
1 0 
2 3
1 0 
-1 1 
1 0 
1 1 
2 3
1 0 
-1 1 
1 0 
1 1 
2 3
1 -1 
0 1 
1 1 
0 1 
2 3...

output:

11aafa73e7e6b339b273565a5bb47429
200
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3...

result:

ok Correct

Test #3:

score: 12
Accepted
time: 1ms
memory: 3968kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
3
1 1 1
0 1 1
0 0 1
0 2 1
0 2 1
3
1 1 1
0 1 1
0 0 1
1 0 2
1 2 0
3
1 1 1
0 1 1
0 0 1
2 1 0
0 2 1
3
1 1 1
0 1 1
0 0 1
2 1 0
1 2 0
3
1 1 1
0 1 1
0 0 1
2 0 1
0 1 2
3
1 1 1
0 1 1
0 0 1
2 1 0
2 0 1
3
1 1 1
0 1 1
0 0 1
1 2 0
2 0 1
3
1 1 1
0 1 1
0 0 1
0 2 1
1 2...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
3 5
1 -1 -1 
-1 1 0 
0 -1 1 
1 1 1 
0 1 0 
0 1 1 
3 5
-1 0 1 
-1 1 -1 
1 -1 0 
1 0 1 
1 1 1 
1 0 0 
3 5
-1 1 0 
0 -1 1 
1 -1 -1 
0 1 0 
0 1 1 
1 1 1 
3 5
1 -1 0 
-1 0 1 
-1 1 -1 
1 0 0 
1 0 1 
1 1 1 
3 5
0 1 -1 
-1 0 1 
1 -1 -1 
0 1 1 
0 0 1 
1 1 1 
3 5...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
3 5
1 -1 -1 
-1 1 0 
0 -1 1 
1 1 1 
0 1 0 
0 1 1 
3 5
-1 0 1 
-1 1 -1 
1 -1 0 
1 0 1 
1 1 1 
1 0 0 
3 5
-1 1 0 
0 -1 1 
1 -1 -1 
0 1 0 
0 1 1 
1 1 1 
3 5
1 -1 0 
-1 0 1 
-1 1 -1 
1 0 0 
1 0 1 
1 1 1 
3 5
0 1 -1 
-1 0 1 
1 -1 -1 
0 1 1 
0 0 1 
1 1 1 
3 5...

output:

11aafa73e7e6b339b273565a5bb47429
200
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 5...

result:

ok Correct

Test #4:

score: 12
Accepted
time: 2ms
memory: 3968kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
5
1 1 1 1 1
0 1 1 1 1
0 0 1 1 1
0 0 0 1 1
0 0 0 0 1
4 0 2 3 1
3 0 2 1 4
5
1 1 1 1 1
0 1 1 1 1
0 0 1 1 1
0 0 0 1 1
0 0 0 0 1
3 1 4 2 0
2 3 0 4 1
5
1 1 1 1 1
0 1 1 1 1
0 0 1 1 1
0 0 0 1 1
0 0 0 0 1
4 0 1 2 3
3 2 4 1 0
5
1 1 1 1 1
0 1 1 1 1
0 0 1 1 1
0 0 0...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
5 9
1 -1 -1 0 -1 
-1 0 -1 -1 1 
0 -1 1 -1 -1 
-1 1 0 -1 -1 
-1 -1 -1 1 -1 
1 1 1 0 1 
0 0 0 0 1 
0 1 1 0 1 
0 1 0 0 1 
1 1 1 1 1 
5 9
-1 1 -1 -1 0 
-1 -1 0 1 -1 
0 -1 -1 -1 1 
-1 -1 1 -1 -1 
1 -1 -1 0 -1 
0 1 0 0 0 
1 1 0 1 1 
0 1 0 0 1 
1 1 1 1 1 
1 1 ...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
5 9
1 -1 -1 0 -1 
-1 0 -1 -1 1 
0 -1 1 -1 -1 
-1 1 0 -1 -1 
-1 -1 -1 1 -1 
1 1 1 0 1 
0 0 0 0 1 
0 1 1 0 1 
0 1 0 0 1 
1 1 1 1 1 
5 9
-1 1 -1 -1 0 
-1 -1 0 1 -1 
0 -1 -1 -1 1 
-1 -1 1 -1 -1 
1 -1 -1 0 -1 
0 1 0 0 0 
1 1 0 1 1 
0 1 0 0 1 
1 1 1 1 1 
1 1 ...

output:

11aafa73e7e6b339b273565a5bb47429
200
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9
5 9...

result:

ok Correct

Test #5:

score: 12
Accepted
time: 2ms
memory: 4096kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
7
1 1 1 1 1 1 1
0 1 1 1 1 1 1
0 0 1 1 1 1 1
0 0 0 1 1 1 1
0 0 0 0 1 1 1
0 0 0 0 0 1 1
0 0 0 0 0 0 1
0 5 6 2 3 1 4
2 4 5 3 6 1 0
7
1 1 1 1 1 1 1
0 1 1 1 1 1 1
0 0 1 1 1 1 1
0 0 0 1 1 1 1
0 0 0 0 1 1 1
0 0 0 0 0 1 1
0 0 0 0 0 0 1
6 0 1 5 2 3 4
4 2 5 6 0 1...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
7 13
-1 -1 1 -1 -1 -1 -1 
-1 1 -1 -1 -1 -1 0 
-1 -1 -1 1 -1 0 -1 
-1 -1 -1 0 -1 -1 1 
1 0 -1 -1 -1 -1 -1 
-1 -1 0 -1 1 -1 -1 
-1 -1 -1 -1 0 1 -1 
1 1 1 1 1 1 1 
1 1 0 0 0 0 0 
1 1 0 1 0 0 1 
1 1 0 0 0 0 1 
1 0 0 0 0 0 0 
1 1 0 1 1 1 1 
1 1 0 1 0 1 1 
7 ...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
7 13
-1 -1 1 -1 -1 -1 -1 
-1 1 -1 -1 -1 -1 0 
-1 -1 -1 1 -1 0 -1 
-1 -1 -1 0 -1 -1 1 
1 0 -1 -1 -1 -1 -1 
-1 -1 0 -1 1 -1 -1 
-1 -1 -1 -1 0 1 -1 
1 1 1 1 1 1 1 
1 1 0 0 0 0 0 
1 1 0 1 0 0 1 
1 1 0 0 0 0 1 
1 0 0 0 0 0 0 
1 1 0 1 1 1 1 
1 1 0 1 0 1 1 
7 ...

output:

11aafa73e7e6b339b273565a5bb47429
200
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 13
7 1...

result:

ok Correct

Test #6:

score: 12
Accepted
time: 3ms
memory: 4096kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
8
1 1 1 1 1 1 1 1
0 1 1 1 1 1 1 1
0 0 1 1 1 1 1 1
0 0 0 1 1 1 1 1
0 0 0 0 1 1 1 1
0 0 0 0 0 1 1 1
0 0 0 0 0 0 1 1
0 0 0 0 0 0 0 1
3 6 5 0 2 1 4 7
7 2 0 3 5 1 6 4
8
1 1 1 1 1 1 1 1
0 1 1 1 1 1 1 1
0 0 1 1 1 1 1 1
0 0 0 1 1 1 1 1
0 0 0 0 1 1 1 1
0 0 0 0 0...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
8 15
0 -1 -1 1 -1 -1 -1 -1 
-1 1 -1 -1 -1 0 -1 -1 
-1 -1 -1 0 -1 1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 1 
-1 0 -1 -1 -1 -1 1 -1 
1 -1 0 -1 -1 -1 -1 -1 
-1 -1 1 -1 -1 -1 -1 0 
-1 -1 -1 -1 1 -1 0 -1 
0 1 0 1 1 1 1 0 
0 1 0 0 1 0 1 0 
0 1 0 0 1 1 1 0 
1 1 1 1 1 1 ...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
8 15
0 -1 -1 1 -1 -1 -1 -1 
-1 1 -1 -1 -1 0 -1 -1 
-1 -1 -1 0 -1 1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 1 
-1 0 -1 -1 -1 -1 1 -1 
1 -1 0 -1 -1 -1 -1 -1 
-1 -1 1 -1 -1 -1 -1 0 
-1 -1 -1 -1 1 -1 0 -1 
0 1 0 1 1 1 1 0 
0 1 0 0 1 0 1 0 
0 1 0 0 1 1 1 0 
1 1 1 1 1 1 ...

output:

11aafa73e7e6b339b273565a5bb47429
200
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 1...

result:

ok Correct

Test #7:

score: 12
Accepted
time: 3ms
memory: 4224kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
10
1 1 1 1 1 1 1 1 1 1
0 1 1 1 1 1 1 1 1 1
0 0 1 1 1 1 1 1 1 1
0 0 0 1 1 1 1 1 1 1
0 0 0 0 1 1 1 1 1 1
0 0 0 0 0 1 1 1 1 1
0 0 0 0 0 0 1 1 1 1
0 0 0 0 0 0 0 1 1 1
0 0 0 0 0 0 0 0 1 1
0 0 0 0 0 0 0 0 0 1
9 3 1 5 2 6 0 4 8 7
8 1 3 0 5 4 6 7 9 2
10
1 1 1 1...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
10 19
-1 -1 -1 -1 0 -1 1 -1 -1 -1 
-1 0 -1 1 -1 -1 -1 -1 -1 -1 
0 -1 -1 -1 -1 1 -1 -1 -1 -1 
-1 1 -1 -1 -1 -1 -1 -1 0 -1 
-1 -1 -1 -1 -1 -1 0 1 -1 -1 
1 -1 -1 0 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 1 0 -1 -1 -1 -1 
-1 -1 1 -1 -1 -1 -1 -1 -1 0 
-1 -1 -1 -1 -1 ...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
10 19
-1 -1 -1 -1 0 -1 1 -1 -1 -1 
-1 0 -1 1 -1 -1 -1 -1 -1 -1 
0 -1 -1 -1 -1 1 -1 -1 -1 -1 
-1 1 -1 -1 -1 -1 -1 -1 0 -1 
-1 -1 -1 -1 -1 -1 0 1 -1 -1 
1 -1 -1 0 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 1 0 -1 -1 -1 -1 
-1 -1 1 -1 -1 -1 -1 -1 -1 0 
-1 -1 -1 -1 -1 ...

output:

11aafa73e7e6b339b273565a5bb47429
200
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19...

result:

ok Correct

Test #8:

score: 12
Accepted
time: 12ms
memory: 5120kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
20
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 0 0 0 0 ...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
20 39
-1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 
0 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 
1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 
-1 -1 -1 -...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
20 39
-1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 
0 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 
1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 
-1 -1 -1 -...

output:

11aafa73e7e6b339b273565a5bb47429
200
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39...

result:

ok Correct

Test #9:

score: 12
Accepted
time: 60ms
memory: 12744kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
50
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
50 99
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
50 99
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
0 -1 -1 -1 -1 -1 -1 -1 -1 -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:

11aafa73e7e6b339b273565a5bb47429
200
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99
50 99...

result:

ok Correct

Test #10:

score: 12
Accepted
time: 111ms
memory: 18304kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 4
499
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
499 997
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
499 997
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -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:

11aafa73e7e6b339b273565a5bb47429
4
499 997
499 997
499 997
499 997

result:

ok Correct

Test #11:

score: 12
Accepted
time: 112ms
memory: 18304kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 4
500
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
500 999
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
500 999
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -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:

11aafa73e7e6b339b273565a5bb47429
4
500 999
500 999
500 999
500 999

result:

ok Correct

Subtask #2:

score: 35
Accepted

Test #12:

score: 35
Accepted
time: 0ms
memory: 3712kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
1
0
0
0
1
0
0
0
1
0
0
0
1
1
0
0
1
0
0
0
1
0
0
0
1
0
0
0
1
0
0
0
1
0
0
0
1
1
0
0
1
1
0
0
1
0
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
0
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
0
0
0
1
0
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
0
0
0
1
0
0
0
1
0
0
0
1
0
0
0
1
1
0
0
1
0
0
0
1
1
0
0
1
0
0...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
1 1
0 
0 
1 1
0 
0 
1 1
0 
0 
1 1
1 
1 
1 1
0 
0 
1 1
0 
0 
1 1
0 
0 
1 1
0 
0 
1 1
0 
0 
1 1
1 
1 
1 1
1 
1 
1 1
0 
0 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
0 
0 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
0 
0 
1 1
0 
0 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
0 
0 
1 1...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
1 1
0 
0 
1 1
0 
0 
1 1
0 
0 
1 1
1 
1 
1 1
0 
0 
1 1
0 
0 
1 1
0 
0 
1 1
0 
0 
1 1
0 
0 
1 1
1 
1 
1 1
1 
1 
1 1
0 
0 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
0 
0 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
0 
0 
1 1
0 
0 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
0 
0 
1 1...

output:

11aafa73e7e6b339b273565a5bb47429
200
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
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

Test #13:

score: 35
Accepted
time: 1ms
memory: 3840kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
2
0 1
0 0
1 0
1 0
2
1 1
0 1
1 0
0 1
2
1 1
1 0
1 0
1 0
2
1 1
1 1
0 1
1 0
2
1 0
0 0
0 1
0 1
2
0 1
0 0
1 0
1 0
2
0 0
0 0
1 0
0 1
2
0 1
0 0
0 1
1 0
2
1 1
0 0
0 1
0 1
2
1 1
1 1
1 0
1 0
2
1 1
0 0
0 1
0 1
2
1 1
1 0
1 0
0 1
2
1 1
1 0
0 1
0 1
2
1 1
1 1
0 1
0 1
2...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
2 3
0 -1 
1 0 
0 0 
1 0 
2 3
0 1 
1 -1 
0 1 
1 1 
2 3
0 1 
1 -1 
0 1 
1 1 
2 2
1 1 
-1 -1 
1 1 
1 1 
2 3
1 0 
0 -1 
1 0 
0 0 
2 3
0 -1 
1 0 
0 0 
1 0 
2 2
-1 0 
-1 0 
0 0 
0 0 
2 3
1 0 
0 -1 
1 0 
0 0 
2 3
1 1 
-1 0 
1 1 
0 0 
2 2
-1 -1 
1 1 
1 1 
1 1 
...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
2 3
0 -1 
1 0 
0 0 
1 0 
2 3
0 1 
1 -1 
0 1 
1 1 
2 3
0 1 
1 -1 
0 1 
1 1 
2 2
1 1 
-1 -1 
1 1 
1 1 
2 3
1 0 
0 -1 
1 0 
0 0 
2 3
0 -1 
1 0 
0 0 
1 0 
2 2
-1 0 
-1 0 
0 0 
0 0 
2 3
1 0 
0 -1 
1 0 
0 0 
2 3
1 1 
-1 0 
1 1 
0 0 
2 2
-1 -1 
1 1 
1 1 
1 1 
...

output:

11aafa73e7e6b339b273565a5bb47429
200
2 3
2 3
2 3
2 2
2 3
2 3
2 2
2 3
2 3
2 2
2 3
2 3
2 3
2 2
2 3
2 2
2 2
2 3
2 3
2 2
2 3
2 3
2 3
2 3
2 3
2 2
2 2
2 3
2 2
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 2
2 3
2 3
2 3
2 3
2 3
2 2
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 2
2 3
2 3
2 2
2 3
2 3
2 3
2 3
2 2
2 3
2 3
2 3
2 3
2 2
2 3
2 3...

result:

ok Correct

Test #14:

score: 35
Accepted
time: 1ms
memory: 3968kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
5
1 1 0 1 1
1 1 0 1 1
0 0 0 1 1
0 0 0 1 0
0 0 0 1 0
2 3 0 4 1
1 4 2 0 3
5
1 1 1 0 1
1 1 0 0 0
1 1 0 0 0
0 0 0 0 0
0 0 0 0 0
0 4 3 2 1
2 3 1 0 4
5
0 1 1 1 0
0 1 1 1 0
0 0 1 1 0
0 0 0 1 0
0 0 0 0 0
0 3 2 1 4
0 4 2 1 3
5
1 1 0 1 1
1 0 0 1 1
1 0 0 1 1
1 0 0...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
5 9
-1 -1 -1 1 0 
-1 -1 -1 0 -1 
-1 1 0 -1 1 
-1 -1 0 -1 -1 
1 -1 -1 0 -1 
1 0 0 1 0 
1 0 0 0 0 
1 1 0 1 1 
1 1 0 1 1 
1 0 0 0 0 
5 9
0 1 -1 -1 1 
-1 -1 -1 0 -1 
-1 -1 -1 0 -1 
-1 -1 -1 -1 0 
-1 -1 1 1 0 
0 1 1 1 1 
0 0 0 0 0 
0 0 0 0 0 
0 0 1 1 0 
0 0 ...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
5 9
-1 -1 -1 1 0 
-1 -1 -1 0 -1 
-1 1 0 -1 1 
-1 -1 0 -1 -1 
1 -1 -1 0 -1 
1 0 0 1 0 
1 0 0 0 0 
1 1 0 1 1 
1 1 0 1 1 
1 0 0 0 0 
5 9
0 1 -1 -1 1 
-1 -1 -1 0 -1 
-1 -1 -1 0 -1 
-1 -1 -1 -1 0 
-1 -1 1 1 0 
0 1 1 1 1 
0 0 0 0 0 
0 0 0 0 0 
0 0 1 1 0 
0 0 ...

output:

11aafa73e7e6b339b273565a5bb47429
200
5 9
5 9
5 8
5 9
5 9
5 9
5 9
5 7
5 9
5 9
5 9
5 9
5 9
5 8
5 8
5 9
5 9
5 8
5 9
5 9
5 9
5 9
5 8
5 9
5 9
5 9
5 8
5 9
5 9
5 9
5 9
5 8
5 9
5 9
5 9
5 9
5 9
5 8
5 8
5 9
5 9
5 9
5 9
5 9
5 9
5 7
5 8
5 9
5 9
5 9
5 9
5 7
5 9
5 9
5 9
5 8
5 9
5 8
5 8
5 9
5 8
5 9
5 9
5 9
5 9
5 9...

result:

ok Correct

Test #15:

score: 35
Accepted
time: 1ms
memory: 3968kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
6
1 0 0 1 1 1
1 0 0 0 1 1
0 0 0 0 1 1
0 0 0 0 0 1
0 0 0 0 0 1
0 0 0 0 0 0
5 2 1 4 0 3
0 5 2 3 1 4
6
1 1 1 1 1 1
0 1 1 1 0 1
0 1 1 1 0 1
0 0 1 1 0 1
0 0 1 1 0 1
0 0 1 0 0 1
1 0 5 3 4 2
5 1 3 2 4 0
6
1 1 0 1 1 1
1 1 0 1 1 0
0 1 0 0 0 0
0 0 0 0 0 0
0 0 0 0...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
6 10
-1 0 -1 -1 -1 -1 
0 1 -1 -1 -1 -1 
1 -1 -1 0 -1 -1 
-1 -1 -1 -1 0 -1 
-1 0 -1 -1 1 -1 
-1 -1 0 1 -1 -1 
0 0 0 0 1 0 
0 1 0 0 1 0 
1 1 0 0 1 0 
0 0 0 0 0 0 
0 0 0 0 1 0 
1 1 0 1 1 0 
6 11
-1 1 -1 -1 0 -1 
-1 -1 -1 -1 1 1 
1 -1 0 1 -1 -1 
-1 0 1 -1 -...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
6 10
-1 0 -1 -1 -1 -1 
0 1 -1 -1 -1 -1 
1 -1 -1 0 -1 -1 
-1 -1 -1 -1 0 -1 
-1 0 -1 -1 1 -1 
-1 -1 0 1 -1 -1 
0 0 0 0 1 0 
0 1 0 0 1 0 
1 1 0 0 1 0 
0 0 0 0 0 0 
0 0 0 0 1 0 
1 1 0 1 1 0 
6 11
-1 1 -1 -1 0 -1 
-1 -1 -1 -1 1 1 
1 -1 0 1 -1 -1 
-1 0 1 -1 -...

output:

11aafa73e7e6b339b273565a5bb47429
200
6 10
6 11
6 11
6 11
6 10
6 11
6 11
6 11
6 10
6 11
6 10
6 11
6 10
6 11
6 11
6 10
6 11
6 11
6 8
6 11
6 11
6 11
6 11
6 11
6 11
6 11
6 11
6 8
6 11
6 10
6 11
6 10
6 10
6 10
6 10
6 11
6 11
6 9
6 10
6 10
6 11
6 11
6 11
6 11
6 10
6 11
6 11
6 11
6 11
6 10
6 9
6 10
6 10
6 ...

result:

ok Correct

Test #16:

score: 35
Accepted
time: 2ms
memory: 4096kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
7
0 1 1 1 1 0 1
0 1 0 1 1 0 1
0 1 0 0 1 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
2 5 0 4 1 3 6
0 5 1 4 3 2 6
7
1 1 1 1 1 0 1
1 1 0 1 1 0 1
1 1 0 1 1 0 1
0 1 0 0 1 0 1
0 0 0 0 0 0 1
0 0 0 0 0 0 1
0 0 0 0 0 0 1
2 1 5 6 3 4 0
4 5 2 3 6 0...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
7 12
-1 -1 -1 1 -1 1 0 
-1 -1 -1 0 -1 -1 -1 
-1 1 0 -1 -1 -1 -1 
-1 -1 -1 0 -1 -1 -1 
-1 -1 -1 0 -1 -1 -1 
-1 0 -1 -1 1 -1 1 
-1 -1 -1 0 -1 -1 -1 
0 0 0 1 0 1 0 
0 0 0 0 0 0 0 
0 1 0 1 1 1 1 
0 0 0 0 0 0 0 
0 0 0 0 0 0 0 
0 0 0 1 1 1 1 
0 0 0 0 0 0 0 
7...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
7 12
-1 -1 -1 1 -1 1 0 
-1 -1 -1 0 -1 -1 -1 
-1 1 0 -1 -1 -1 -1 
-1 -1 -1 0 -1 -1 -1 
-1 -1 -1 0 -1 -1 -1 
-1 0 -1 -1 1 -1 1 
-1 -1 -1 0 -1 -1 -1 
0 0 0 1 0 1 0 
0 0 0 0 0 0 0 
0 1 0 1 1 1 1 
0 0 0 0 0 0 0 
0 0 0 0 0 0 0 
0 0 0 1 1 1 1 
0 0 0 0 0 0 0 
7...

output:

11aafa73e7e6b339b273565a5bb47429
200
7 12
7 13
7 13
7 13
7 13
7 12
7 13
7 12
7 13
7 12
7 13
7 13
7 13
7 12
7 11
7 13
7 13
7 13
7 13
7 12
7 12
7 13
7 13
7 13
7 13
7 12
7 13
7 13
7 13
7 13
7 13
7 12
7 13
7 12
7 13
7 13
7 13
7 12
7 13
7 12
7 13
7 13
7 13
7 13
7 13
7 13
7 12
7 13
7 13
7 12
7 12
7 12
7 1...

result:

ok Correct

Test #17:

score: 35
Accepted
time: 2ms
memory: 3968kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
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
0 1 1 1 1 1 1 1
0 0 1 0 1 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
5 0 2 6 1 4 7 3
2 4 0 5 6 3 7 1
8
1 0 1 0 1 1 0 0
1 0 1 0 1 1 0 0
1 0 1 0 1 1 0 0
1 0 1 0 1 1 0 0
1 0 1 0 0 0 0 0
1 0 1 0 0...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
8 13
-1 -1 -1 -1 -1 -1 -1 -1 
1 0 -1 -1 -1 -1 1 -1 
-1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 0 -1 
-1 -1 -1 -1 -1 -1 0 -1 
-1 -1 1 -1 -1 -1 -1 -1 
-1 1 0 1 1 1 -1 1 
-1 -1 -1 -1 -1 -1 0 -1 
1 1 1 1 1 1 1 1 
1 0 0 0 0 0 1 0 
1 1 1 1 1 1 1 1 
0 0 0 0 0 ...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
8 13
-1 -1 -1 -1 -1 -1 -1 -1 
1 0 -1 -1 -1 -1 1 -1 
-1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 0 -1 
-1 -1 -1 -1 -1 -1 0 -1 
-1 -1 1 -1 -1 -1 -1 -1 
-1 1 0 1 1 1 -1 1 
-1 -1 -1 -1 -1 -1 0 -1 
1 1 1 1 1 1 1 1 
1 0 0 0 0 0 1 0 
1 1 1 1 1 1 1 1 
0 0 0 0 0 ...

output:

11aafa73e7e6b339b273565a5bb47429
200
8 13
8 12
8 14
8 14
8 14
8 15
8 13
8 15
8 14
8 15
8 15
8 14
8 15
8 14
8 15
8 14
8 15
8 15
8 15
8 15
8 15
8 14
8 15
8 14
8 14
8 15
8 15
8 15
8 15
8 15
8 14
8 14
8 13
8 14
8 15
8 14
8 15
8 15
8 14
8 15
8 15
8 15
8 15
8 13
8 11
8 15
8 14
8 15
8 13
8 15
8 15
8 15
8 1...

result:

ok Correct

Test #18:

score: 35
Accepted
time: 2ms
memory: 4096kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
10
0 1 1 0 1 1 0 1 1 1
0 1 1 0 1 1 0 1 1 1
0 1 1 0 1 1 0 1 1 1
0 0 1 0 1 1 0 1 1 1
0 0 1 0 1 1 0 1 1 1
0 0 1 0 1 1 0 1 1 1
0 0 1 0 1 1 0 1 0 1
0 0 0 0 1 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
5 6 7 3 2 0 4 1 8 9
5 6 2 8 7 1 9 4 3 0
10
1 1 1 1...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
10 17
-1 -1 -1 -1 -1 -1 0 -1 -1 -1 
0 1 -1 -1 -1 -1 -1 1 -1 -1 
-1 -1 -1 -1 -1 -1 0 -1 -1 -1 
-1 -1 -1 1 -1 -1 0 -1 -1 -1 
1 -1 1 0 1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 1 -1 -1 0 
-1 -1 -1 -1 -1 -1 -1 -1 -1 0 
-1 -1 -1 -1 -1 -1 -1 -1 -1 0 
-1 0 -1 -1 -1 ...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
10 17
-1 -1 -1 -1 -1 -1 0 -1 -1 -1 
0 1 -1 -1 -1 -1 -1 1 -1 -1 
-1 -1 -1 -1 -1 -1 0 -1 -1 -1 
-1 -1 -1 1 -1 -1 0 -1 -1 -1 
1 -1 1 0 1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 1 -1 -1 0 
-1 -1 -1 -1 -1 -1 -1 -1 -1 0 
-1 -1 -1 -1 -1 -1 -1 -1 -1 0 
-1 0 -1 -1 -1 ...

output:

11aafa73e7e6b339b273565a5bb47429
200
10 17
10 18
10 19
10 18
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 18
10 19
10 19
10 18
10 19
10 19
10 19
10 17
10 18
10 19
10 19
10 18
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 19
10 18
10 19
10 19
10 17
10 19
10 19
10 19
10 18
10 19
10 19
10 19...

result:

ok Correct

Test #19:

score: 35
Accepted
time: 12ms
memory: 5120kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
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 1 1 0
1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
1 1 1 0 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 0
1 0 1 0 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 0
1 0 1 0 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 0
1 0 1 0 1 ...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
20 39
-1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 1 -1 1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 
-1 -1 0 -...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
20 39
-1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 1 -1 1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 
-1 -1 0 -...

output:

11aafa73e7e6b339b273565a5bb47429
200
20 39
20 38
20 39
20 39
20 38
20 38
20 36
20 38
20 39
20 38
20 39
20 39
20 38
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 38
20 39
20 39
20 39
20 39
20 35
20 39
20 39
20 39
20 37
20 39
20 39
20 39
20 39
20 37
20 39
20 36
20 39
20 39
20 39
20 37
20 39
20 38...

result:

ok Correct

Test #20:

score: 35
Accepted
time: 123ms
memory: 16768kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 100
100
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 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:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 100
100 199
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 100
100 199
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -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:

11aafa73e7e6b339b273565a5bb47429
100
100 199
100 199
100 196
100 199
100 199
100 199
100 199
100 199
100 199
100 199
100 198
100 196
100 198
100 198
100 197
100 197
100 199
100 198
100 198
100 198
100 199
100 199
100 199
100 199
100 199
100 199
100 197
100 199
100 199
100 198
100 199
100 198
100 198...

result:

ok Correct

Test #21:

score: 35
Accepted
time: 112ms
memory: 18304kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 4
499
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
499 997
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
499 997
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -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:

11aafa73e7e6b339b273565a5bb47429
4
499 997
499 997
499 996
499 997

result:

ok Correct

Test #22:

score: 35
Accepted
time: 116ms
memory: 18304kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 4
500
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
500 999
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
500 999
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -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:

11aafa73e7e6b339b273565a5bb47429
4
500 999
500 998
500 999
500 999

result:

ok Correct

Test #23:

score: 35
Accepted
time: 79ms
memory: 13824kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 4
405
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
405 405
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
405 405
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -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:

11aafa73e7e6b339b273565a5bb47429
4
405 405
437 437
414 414
415 415

result:

ok Correct

Test #24:

score: 35
Accepted
time: 97ms
memory: 16768kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 4
408
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
408 745
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
408 745
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -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:

11aafa73e7e6b339b273565a5bb47429
4
408 745
466 931
488 975
495 989

result:

ok Correct

Test #25:

score: 35
Accepted
time: 93ms
memory: 15488kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 4
454
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
454 906
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
454 906
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -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:

11aafa73e7e6b339b273565a5bb47429
4
454 906
411 821
489 977
445 889

result:

ok Correct

Test #26:

score: 35
Accepted
time: 46ms
memory: 9472kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
49
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
49 49
-1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
49 49
-1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 -1 -1 0 -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:

11aafa73e7e6b339b273565a5bb47429
200
49 49
42 42
45 89
49 49
50 50
41 41
40 79
41 81
50 50
43 43
43 85
49 97
47 93
40 79
48 48
43 43
50 99
41 81
47 93
45 89
42 42
40 79
40 40
47 93
47 93
49 49
42 83
44 44
42 42
41 81
48 95
50 50
45 89
45 45
45 89
49 97
40 40
40 79
40 79
50 50
49 97
40 79
48 48
40 79...

result:

ok Correct

Test #27:

score: 35
Accepted
time: 51ms
memory: 9472kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
50
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
50 99
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 ...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
50 99
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 -1 -1 -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:

11aafa73e7e6b339b273565a5bb47429
200
50 99
49 58
44 87
47 89
49 49
46 46
47 93
41 41
46 91
46 89
44 87
43 85
47 93
47 88
50 95
48 82
42 83
49 89
43 54
42 83
40 79
47 73
42 42
46 91
42 42
40 68
42 83
47 93
49 74
48 93
40 79
49 97
42 83
44 63
40 79
45 89
48 95
44 87
43 78
41 81
43 85
45 82
48 95
45 89...

result:

ok Correct

Test #28:

score: 35
Accepted
time: 52ms
memory: 9856kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
43
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
43 84
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 1 0 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
43 84
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 1 0 1 -1 -1 -1 -1 -1 -1 -1 -1 -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:

11aafa73e7e6b339b273565a5bb47429
200
43 84
43 85
44 85
50 99
41 81
40 77
43 83
40 79
45 89
47 93
40 79
47 93
48 87
43 76
50 98
50 90
43 75
49 97
40 63
42 83
47 84
47 93
46 89
40 79
50 97
44 86
43 85
43 85
43 74
44 68
49 97
41 65
48 95
45 89
41 81
46 91
49 96
49 97
45 89
50 92
47 90
44 86
41 81
46 91...

result:

ok Correct

Test #29:

score: 35
Accepted
time: 54ms
memory: 9728kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
42
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
42 79
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
42 79
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -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:

11aafa73e7e6b339b273565a5bb47429
200
42 79
42 78
41 77
43 84
44 82
40 78
45 87
44 87
50 95
40 73
45 89
46 91
40 79
49 96
43 85
45 80
45 83
43 84
45 89
41 78
42 77
43 85
45 86
44 84
41 80
45 86
50 99
50 99
43 85
43 85
50 98
46 90
46 91
41 81
46 90
49 94
44 86
40 70
47 90
45 89
48 95
45 89
40 75
40 78...

result:

ok Correct

Test #30:

score: 35
Accepted
time: 48ms
memory: 9728kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
49
1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
49 97
-1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
49 97
-1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 -1 0 -1 -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:

11aafa73e7e6b339b273565a5bb47429
200
49 97
40 79
49 97
41 77
49 92
46 91
47 92
46 89
50 99
45 89
45 89
40 79
43 85
46 87
41 75
46 91
44 87
44 86
49 97
42 78
46 90
42 83
43 85
48 95
44 86
42 83
42 81
44 87
50 99
41 81
46 91
48 95
41 80
47 90
45 89
44 87
43 81
48 94
41 81
44 87
45 89
49 97
46 89
41 81...

result:

ok Correct

Test #31:

score: 35
Accepted
time: 3ms
memory: 4352kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
16
1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1
1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1
1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1
1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1
1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1
1 0 1 0 1 1 1 0 1 1 1 1 1 1 1 1
1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 1
0 0 0 0 1 0 1 0 1 1 0 1 1 ...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
16 31
-1 -1 -1 -1 1 -1 -1 -1 -1 1 0 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 0 -1 -1 -1 1 -1 -1 -1 -1 -1 
-1 1 1 1 -1 -1 -1 -1 1 0 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 ...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
16 31
-1 -1 -1 -1 1 -1 -1 -1 -1 1 0 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 0 -1 -1 -1 1 -1 -1 -1 -1 -1 
-1 1 1 1 -1 -1 -1 -1 1 0 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 ...

output:

11aafa73e7e6b339b273565a5bb47429
200
16 31
1 1
6 11
13 25
6 11
6 11
5 9
5 9
8 11
13 25
10 19
1 1
14 26
13 25
18 32
13 25
19 36
9 17
14 24
9 17
20 38
20 39
4 6
1 1
17 26
20 37
20 38
15 29
6 10
5 8
6 11
11 21
14 27
13 23
20 39
13 25
12 21
1 1
17 31
13 25
2 3
15 27
16 31
15 29
11 21
16 27
7 11
11 19
2 ...

result:

ok Correct

Test #32:

score: 35
Accepted
time: 4ms
memory: 4352kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
8
1 1 1 1 1 1 1 0
1 1 1 1 1 1 0 0
1 1 1 1 1 0 0 0
1 1 1 1 0 0 0 0
1 1 1 0 0 0 0 0
1 1 0 0 0 0 0 0
1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
4 5 1 6 3 0 2 7
1 4 0 2 6 7 3 5
5
1 1 1 1 0
1 1 1 0 0
1 1 0 0 0
1 0 0 0 0
0 0 0 0 0
0 1 4 3 2
2 0 1 4 3
18
1 1 1 1 1 1 1 1 ...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
8 15
0 -1 -1 -1 1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 1 0 
-1 1 -1 -1 0 -1 -1 -1 
1 -1 0 -1 -1 -1 -1 -1 
-1 -1 -1 1 -1 0 -1 -1 
-1 -1 -1 0 -1 -1 -1 1 
-1 -1 1 -1 -1 -1 0 -1 
-1 0 -1 -1 -1 -1 -1 -1 
0 1 0 0 1 0 0 0 
1 1 1 0 1 0 1 0 
0 1 0 0 0 0 0 0 
1 1 0 0 1 0 ...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
8 15
0 -1 -1 -1 1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 1 0 
-1 1 -1 -1 0 -1 -1 -1 
1 -1 0 -1 -1 -1 -1 -1 
-1 -1 -1 1 -1 0 -1 -1 
-1 -1 -1 0 -1 -1 -1 1 
-1 -1 1 -1 -1 -1 0 -1 
-1 0 -1 -1 -1 -1 -1 -1 
0 1 0 0 1 0 0 0 
1 1 1 0 1 0 1 0 
0 1 0 0 0 0 0 0 
1 1 0 0 1 0 ...

output:

11aafa73e7e6b339b273565a5bb47429
200
8 15
5 9
18 18
1 1
17 17
9 17
11 11
13 25
15 29
5 9
1 1
2 2
20 39
16 31
17 17
10 19
4 7
15 15
4 7
3 3
20 20
12 12
19 19
2 2
13 13
1 1
20 20
16 16
20 20
12 23
9 9
13 25
7 7
19 37
16 31
11 11
6 6
17 33
20 20
16 16
7 13
17 33
5 5
14 14
13 13
6 11
7 7
18 35
4 7
15 29...

result:

ok Correct

Test #33:

score: 35
Accepted
time: 36ms
memory: 8576kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 100
1
1
0
0
2
0 1
0 0
0 1
1 0
3
1 0 0
0 0 0
0 0 0
2 0 1
1 2 0
4
0 0 1 0
0 0 0 0
0 0 0 0
0 0 0 0
2 1 3 0
0 2 1 3
5
0 1 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
1 0 4 2 3
3 1 0 2 4
6
1 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 100
1 1
1 
1 
2 3
1 0 
0 -1 
1 0 
0 0 
3 4
-1 0 -1 
-1 0 -1 
0 1 -1 
0 0 0 
0 0 0 
0 1 0 
4 5
-1 0 -1 -1 
-1 0 -1 -1 
-1 1 -1 0 
-1 0 -1 -1 
0 0 0 0 
0 0 0 0 
0 1 0 0 
0 0 0 0 
5 6
-1 0 -1 -1 -1 
-1 1 -1 -1 0 
-1 0 -1 -1 -1 
-1 0 -1 -1 -1 
-1 0 -1 -1 -1 
0 ...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 100
1 1
1 
1 
2 3
1 0 
0 -1 
1 0 
0 0 
3 4
-1 0 -1 
-1 0 -1 
0 1 -1 
0 0 0 
0 0 0 
0 1 0 
4 5
-1 0 -1 -1 
-1 0 -1 -1 
-1 1 -1 0 
-1 0 -1 -1 
0 0 0 0 
0 0 0 0 
0 1 0 0 
0 0 0 0 
5 6
-1 0 -1 -1 -1 
-1 1 -1 -1 0 
-1 0 -1 -1 -1 
-1 0 -1 -1 -1 
-1 0 -1 -1 -1 
0 ...

output:

11aafa73e7e6b339b273565a5bb47429
100
1 1
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 47
47 4...

result:

ok Correct

Test #34:

score: 35
Accepted
time: 1ms
memory: 3840kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
1
1
0
0
1
0
0
0
1
1
0
0
1
0
0
0
1
0
0
0
1
0
0
0
1
1
0
0
1
1
0
0
1
0
0
0
1
0
0
0
1
0
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
0
0
0
1
0
0
0
1
0
0
0
1
0
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
0
0
0
1
1
0
0
1
0
0
0
1
0
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
0
0
0
1
0
0
0
1
0
0
0
1
0
0...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
1 1
1 
1 
1 1
0 
0 
1 1
1 
1 
1 1
0 
0 
1 1
0 
0 
1 1
0 
0 
1 1
1 
1 
1 1
1 
1 
1 1
0 
0 
1 1
0 
0 
1 1
0 
0 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
0 
0 
1 1
0 
0 
1 1
0 
0 
1 1
0 
0 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
0 
0 
1 1
1 
1 
1 1
0 
0 
1 1
0 
0 
1 1...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
1 1
1 
1 
1 1
0 
0 
1 1
1 
1 
1 1
0 
0 
1 1
0 
0 
1 1
0 
0 
1 1
1 
1 
1 1
1 
1 
1 1
0 
0 
1 1
0 
0 
1 1
0 
0 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
0 
0 
1 1
0 
0 
1 1
0 
0 
1 1
0 
0 
1 1
1 
1 
1 1
1 
1 
1 1
1 
1 
1 1
0 
0 
1 1
1 
1 
1 1
0 
0 
1 1
0 
0 
1 1...

output:

11aafa73e7e6b339b273565a5bb47429
200
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
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

Test #35:

score: 35
Accepted
time: 86ms
memory: 15360kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 4
418
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
418 418
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
418 418
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -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:

11aafa73e7e6b339b273565a5bb47429
4
418 418
455 455
452 452
455 455

result:

ok Correct

Subtask #3:

score: 53
Accepted

Test #36:

score: 53
Accepted
time: 1ms
memory: 3840kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 2
5
1 0 0 0 0
1 1 1 0 0
1 1 0 0 0
1 1 1 0 1
0 0 0 0 0
2 1 4 0 3
0 1 2 3 4
5
1 1 1 1 1
0 1 1 1 1
0 0 1 1 1
0 0 0 1 1
0 0 0 0 1
2 1 4 0 3
3 0 1 4 2

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 2
5 9
-1 -1 -1 0 1 
-1 -1 1 -1 0 
1 0 -1 -1 -1 
0 -1 -1 -1 -1 
-1 1 0 -1 -1 
1 1 1 0 1 
1 1 1 0 0 
1 0 0 0 0 
0 0 0 0 0 
1 1 0 0 0 
5 9
-1 0 -1 -1 1 
1 -1 -1 0 -1 
-1 -1 -1 1 -1 
-1 -1 1 -1 0 
0 1 -1 -1 -1 
0 0 1 0 1 
1 1 1 0 1 
1 1 1 1 1 
0 0 1 0 0 
0 1 1 ...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 2
5 9
-1 -1 -1 0 1 
-1 -1 1 -1 0 
1 0 -1 -1 -1 
0 -1 -1 -1 -1 
-1 1 0 -1 -1 
1 1 1 0 1 
1 1 1 0 0 
1 0 0 0 0 
0 0 0 0 0 
1 1 0 0 0 
5 9
-1 0 -1 -1 1 
1 -1 -1 0 -1 
-1 -1 -1 1 -1 
-1 -1 1 -1 0 
0 1 -1 -1 -1 
0 0 1 0 1 
1 1 1 0 1 
1 1 1 1 1 
0 0 1 0 0 
0 1 1 ...

output:

11aafa73e7e6b339b273565a5bb47429
2
5 9
5 9

result:

ok Correct

Test #37:

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

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
2
0 0
0 1
0 1
0 1
2
1 1
1 1
0 1
1 0
2
1 1
1 1
1 0
0 1
2
1 1
0 1
0 1
0 1
2
1 1
0 0
1 0
1 0
2
0 0
0 1
1 0
0 1
2
1 1
1 1
1 0
1 0
2
0 0
0 1
1 0
1 0
2
1 0
1 0
1 0
1 0
2
0 1
0 1
1 0
1 0
2
1 1
1 1
0 1
1 0
2
0 0
0 1
1 0
1 0
2
0 0
1 1
1 0
0 1
2
0 1
0 1
0 1
1 0
2...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
2 3
-1 0 
0 1 
0 0 
0 1 
2 2
1 1 
-1 -1 
1 1 
1 1 
2 2
-1 -1 
1 1 
1 1 
1 1 
2 3
1 -1 
0 1 
1 1 
0 1 
2 3
0 -1 
1 1 
0 0 
1 1 
2 3
0 1 
-1 0 
0 1 
0 0 
2 2
-1 -1 
1 1 
1 1 
1 1 
2 3
1 0 
0 -1 
1 0 
0 0 
2 3
0 -1 
0 1 
0 1 
0 1 
2 3
-1 0 
1 0 
1 0 
1 0 
...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
2 3
-1 0 
0 1 
0 0 
0 1 
2 2
1 1 
-1 -1 
1 1 
1 1 
2 2
-1 -1 
1 1 
1 1 
1 1 
2 3
1 -1 
0 1 
1 1 
0 1 
2 3
0 -1 
1 1 
0 0 
1 1 
2 3
0 1 
-1 0 
0 1 
0 0 
2 2
-1 -1 
1 1 
1 1 
1 1 
2 3
1 0 
0 -1 
1 0 
0 0 
2 3
0 -1 
0 1 
0 1 
0 1 
2 3
-1 0 
1 0 
1 0 
1 0 
...

output:

11aafa73e7e6b339b273565a5bb47429
200
2 3
2 2
2 2
2 3
2 3
2 3
2 2
2 3
2 3
2 3
2 2
2 3
2 3
2 3
2 2
2 2
2 3
2 3
2 3
2 3
2 3
2 2
2 3
2 3
2 2
2 3
2 2
2 3
2 2
2 3
2 2
2 2
2 2
2 3
2 3
2 3
2 3
2 3
2 2
2 3
2 2
2 3
2 3
2 2
2 3
2 3
2 2
2 3
2 3
2 2
2 3
2 3
2 2
2 2
2 3
2 2
2 3
2 3
2 3
2 2
2 2
2 3
2 2
2 2
2 3
2 3...

result:

ok Correct

Test #38:

score: 53
Accepted
time: 1ms
memory: 3840kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
3
0 0 0
1 1 0
1 0 0
2 0 1
1 0 2
3
1 1 1
1 1 1
1 1 1
1 0 2
2 1 0
3
1 0 1
0 0 0
1 0 1
0 1 2
2 0 1
3
1 1 0
1 1 0
1 1 1
1 0 2
1 2 0
3
0 0 0
0 0 1
0 0 1
1 0 2
0 2 1
3
0 0 1
0 0 1
1 0 1
0 1 2
1 0 2
3
1 0 0
1 0 1
1 0 1
2 1 0
2 0 1
3
0 0 0
0 0 0
0 0 0
2 0 1
1 0...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
3 5
1 -1 0 
0 1 -1 
-1 0 -1 
1 1 0 
0 1 0 
0 0 0 
3 3
-1 -1 -1 
1 1 1 
-1 -1 -1 
1 1 1 
1 1 1 
1 1 1 
3 5
0 1 1 
-1 0 -1 
0 -1 -1 
0 1 1 
0 0 0 
0 1 1 
3 5
0 -1 -1 
0 1 1 
1 -1 -1 
0 1 1 
0 1 1 
1 1 1 
3 4
-1 1 0 
-1 0 -1 
-1 -1 0 
0 1 0 
0 0 0 
0 1 0 
...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
3 5
1 -1 0 
0 1 -1 
-1 0 -1 
1 1 0 
0 1 0 
0 0 0 
3 3
-1 -1 -1 
1 1 1 
-1 -1 -1 
1 1 1 
1 1 1 
1 1 1 
3 5
0 1 1 
-1 0 -1 
0 -1 -1 
0 1 1 
0 0 0 
0 1 1 
3 5
0 -1 -1 
0 1 1 
1 -1 -1 
0 1 1 
0 1 1 
1 1 1 
3 4
-1 1 0 
-1 0 -1 
-1 -1 0 
0 1 0 
0 0 0 
0 1 0 
...

output:

11aafa73e7e6b339b273565a5bb47429
200
3 5
3 3
3 5
3 5
3 4
3 5
3 5
3 3
3 5
3 4
3 5
3 5
3 5
3 5
3 5
3 3
3 4
3 5
3 5
3 5
3 5
3 4
3 3
3 5
3 5
3 4
3 4
3 5
3 5
3 3
3 4
3 5
3 4
3 4
3 5
3 5
3 5
3 4
3 5
3 5
3 5
3 4
3 5
3 5
3 4
3 4
3 5
3 5
3 5
3 5
3 5
3 4
3 5
3 4
3 5
3 5
3 4
3 5
3 5
3 5
3 5
3 5
3 5
3 5
3 4
3 3...

result:

ok Correct

Test #39:

score: 53
Accepted
time: 1ms
memory: 3968kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
4
0 0 1 0
0 0 1 0
1 1 1 1
1 1 1 1
0 3 2 1
2 0 3 1
4
0 0 1 0
0 0 1 0
1 1 1 1
0 0 1 0
3 0 1 2
0 2 3 1
4
1 1 1 1
1 1 1 1
1 0 0 0
1 0 0 0
1 3 2 0
2 3 0 1
4
0 1 1 0
1 1 1 1
1 1 1 1
1 1 1 1
2 0 1 3
3 1 2 0
4
1 0 1 1
1 0 1 0
1 0 1 1
1 0 1 1
1 3 0 2
0 2 1 3
4
0...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
4 6
-1 0 -1 1 
-1 -1 -1 -1 
1 1 1 -1 
-1 0 -1 -1 
0 0 0 1 
1 1 1 1 
1 1 1 1 
0 0 0 1 
4 7
-1 0 -1 -1 
1 1 1 -1 
-1 0 -1 -1 
-1 0 -1 1 
0 0 0 1 
1 1 1 1 
0 0 0 1 
0 0 0 1 
4 6
-1 0 -1 -1 
1 1 -1 1 
-1 0 1 -1 
-1 -1 -1 -1 
0 0 1 0 
1 1 1 1 
0 0 1 0 
1 1 1...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
4 6
-1 0 -1 1 
-1 -1 -1 -1 
1 1 1 -1 
-1 0 -1 -1 
0 0 0 1 
1 1 1 1 
1 1 1 1 
0 0 0 1 
4 7
-1 0 -1 -1 
1 1 1 -1 
-1 0 -1 -1 
-1 0 -1 1 
0 0 0 1 
1 1 1 1 
0 0 0 1 
0 0 0 1 
4 6
-1 0 -1 -1 
1 1 -1 1 
-1 0 1 -1 
-1 -1 -1 -1 
0 0 1 0 
1 1 1 1 
0 0 1 0 
1 1 1...

output:

11aafa73e7e6b339b273565a5bb47429
200
4 6
4 7
4 6
4 5
4 7
4 7
4 5
4 7
4 7
4 5
4 6
4 6
4 7
4 7
4 7
4 7
4 7
4 6
4 7
4 7
4 4
4 7
4 7
4 7
4 7
4 7
4 6
4 5
4 5
4 7
4 5
4 7
4 7
4 6
4 5
4 7
4 7
4 7
4 7
4 4
4 4
4 7
4 5
4 7
4 7
4 5
4 7
4 6
4 4
4 5
4 7
4 7
4 6
4 7
4 6
4 6
4 6
4 6
4 7
4 7
4 7
4 7
4 7
4 4
4 7
4 7...

result:

ok Correct

Test #40:

score: 53
Accepted
time: 2ms
memory: 3840kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
5
0 1 1 0 0
1 1 1 1 1
0 1 1 1 0
0 1 1 0 0
0 1 1 0 0
2 4 3 1 0
3 0 2 1 4
5
0 1 1 1 1
1 1 1 1 1
1 1 1 1 1
0 1 0 0 0
0 1 1 1 1
1 0 2 3 4
3 2 0 1 4
5
0 0 0 0 0
1 1 1 1 1
1 1 0 1 0
1 1 1 1 1
1 1 0 1 1
4 1 0 2 3
4 2 1 0 3
5
0 0 0 1 0
0 1 0 1 1
0 1 0 1 0
0 1 0...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
5 9
-1 0 -1 -1 -1 
-1 0 -1 -1 -1 
1 0 1 -1 -1 
-1 1 -1 -1 0 
-1 -1 -1 1 1 
1 0 1 0 0 
1 0 1 0 0 
1 0 1 0 0 
1 1 1 0 0 
1 1 1 1 1 
5 8
-1 -1 -1 1 -1 
1 1 -1 0 1 
-1 -1 -1 -1 -1 
-1 -1 1 -1 0 
-1 -1 -1 0 -1 
1 1 1 1 1 
1 1 1 0 1 
1 1 1 1 1 
0 0 1 0 0 
1 1...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
5 9
-1 0 -1 -1 -1 
-1 0 -1 -1 -1 
1 0 1 -1 -1 
-1 1 -1 -1 0 
-1 -1 -1 1 1 
1 0 1 0 0 
1 0 1 0 0 
1 0 1 0 0 
1 1 1 0 0 
1 1 1 1 1 
5 8
-1 -1 -1 1 -1 
1 1 -1 0 1 
-1 -1 -1 -1 -1 
-1 -1 1 -1 0 
-1 -1 -1 0 -1 
1 1 1 1 1 
1 1 1 0 1 
1 1 1 1 1 
0 0 1 0 0 
1 1...

output:

11aafa73e7e6b339b273565a5bb47429
200
5 9
5 8
5 8
5 9
5 8
5 9
5 8
5 9
5 8
5 8
5 8
5 9
5 8
5 8
5 9
5 9
5 8
5 7
5 7
5 9
5 9
5 7
5 8
5 8
5 9
5 9
5 8
5 8
5 9
5 9
5 9
5 9
5 8
5 9
5 9
5 9
5 8
5 6
5 6
5 9
5 9
5 8
5 7
5 8
5 7
5 9
5 7
5 8
5 9
5 9
5 9
5 8
5 8
5 9
5 9
5 8
5 9
5 9
5 8
5 9
5 8
5 9
5 7
5 8
5 8
5 8...

result:

ok Correct

Test #41:

score: 53
Accepted
time: 2ms
memory: 3968kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
7
0 0 0 0 0 0 0
1 0 0 0 1 0 0
1 0 0 0 1 0 0
1 0 1 1 1 1 0
1 0 1 1 1 1 1
1 0 0 0 1 0 0
1 0 1 1 1 1 0
4 1 6 2 3 5 0
5 2 3 1 6 4 0
7
0 0 1 1 0 1 1
0 0 0 1 0 0 1
1 1 1 1 1 1 1
0 0 1 1 0 1 1
0 0 1 1 0 0 1
0 0 0 0 0 0 0
0 0 0 1 0 0 1
5 1 4 6 2 3 0
6 5 0 3 1 4...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
7 13
0 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 0 1 1 
0 1 -1 1 1 -1 -1 
1 -1 0 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 0 
-1 -1 -1 -1 0 -1 -1 
-1 -1 -1 -1 0 -1 -1 
0 1 0 1 1 1 1 
0 0 0 0 0 1 1 
0 1 0 1 1 1 1 
1 1 0 1 1 1 1 
0 0 0 0 0 0 0 
0 0 0 0 0 1 1 
0 0 0 0 0 1 1 
7 ...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
7 13
0 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 0 1 1 
0 1 -1 1 1 -1 -1 
1 -1 0 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 0 
-1 -1 -1 -1 0 -1 -1 
-1 -1 -1 -1 0 -1 -1 
0 1 0 1 1 1 1 
0 0 0 0 0 1 1 
0 1 0 1 1 1 1 
1 1 0 1 1 1 1 
0 0 0 0 0 0 0 
0 0 0 0 0 1 1 
0 0 0 0 0 1 1 
7 ...

output:

11aafa73e7e6b339b273565a5bb47429
200
7 13
7 13
7 13
7 12
7 13
7 13
7 12
7 13
7 13
7 13
7 12
7 13
7 11
7 13
7 13
7 13
7 13
7 12
7 13
7 13
7 12
7 10
7 13
7 13
7 12
7 12
7 13
7 11
7 12
7 13
7 12
7 13
7 13
7 12
7 13
7 13
7 13
7 13
7 13
7 12
7 13
7 12
7 13
7 13
7 13
7 12
7 13
7 13
7 13
7 10
7 13
7 13
7 1...

result:

ok Correct

Test #42:

score: 53
Accepted
time: 2ms
memory: 4224kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
8
0 0 0 1 0 0 1 1
0 0 1 1 0 0 1 1
0 0 1 1 0 0 1 1
0 0 0 1 0 0 1 1
0 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
0 1 1 1 1 1 1 1
0 0 0 0 0 0 1 1
4 0 2 5 7 3 6 1
4 7 5 3 1 6 2 0
8
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 1 1 1 0 1 1 0
0 1 1 1 0 1 1 0
0 0 0 0 0 0 0 0
0 0 0 0 0...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
8 15
-1 -1 -1 -1 -1 1 0 -1 
1 -1 1 0 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 0 -1 
-1 -1 -1 -1 1 -1 -1 -1 
-1 -1 -1 1 -1 0 -1 -1 
-1 -1 -1 -1 -1 0 -1 -1 
-1 -1 -1 -1 0 -1 -1 -1 
-1 1 -1 -1 0 -1 1 1 
1 0 1 1 0 1 0 0 
1 0 1 0 0 0 0 0 
1 0 1 1 0 1 0 0 
1 1 1 1 1 1 ...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
8 15
-1 -1 -1 -1 -1 1 0 -1 
1 -1 1 0 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 0 -1 
-1 -1 -1 -1 1 -1 -1 -1 
-1 -1 -1 1 -1 0 -1 -1 
-1 -1 -1 -1 -1 0 -1 -1 
-1 -1 -1 -1 0 -1 -1 -1 
-1 1 -1 -1 0 -1 1 1 
1 0 1 1 0 1 0 0 
1 0 1 0 0 0 0 0 
1 0 1 1 0 1 0 0 
1 1 1 1 1 1 ...

output:

11aafa73e7e6b339b273565a5bb47429
200
8 15
8 13
8 14
8 11
8 13
8 13
8 13
8 15
8 15
8 13
8 14
8 15
8 15
8 15
8 15
8 12
8 13
8 15
8 15
8 15
8 15
8 14
8 15
8 14
8 15
8 15
8 15
8 15
8 15
8 15
8 15
8 14
8 14
8 13
8 15
8 15
8 14
8 15
8 15
8 15
8 13
8 15
8 15
8 15
8 15
8 13
8 15
8 15
8 15
8 15
8 14
8 14
8 1...

result:

ok Correct

Test #43:

score: 53
Accepted
time: 4ms
memory: 4096kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
10
0 1 1 1 1 0 0 0 1 1
1 1 1 1 1 0 1 1 1 1
0 0 1 1 0 0 0 0 1 0
1 1 1 1 1 0 1 1 1 1
0 0 1 1 0 0 0 0 1 0
0 0 0 1 0 0 0 0 1 0
0 0 1 1 0 0 0 0 1 1
1 1 1 1 1 0 1 1 1 1
1 1 1 1 1 0 0 0 1 1
1 1 1 1 1 0 0 0 1 1
9 8 7 5 1 4 0 3 6 2
7 0 2 5 6 3 8 9 1 4
10
1 1 1 1...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
10 19
-1 -1 -1 -1 1 -1 0 -1 -1 -1 
-1 -1 -1 -1 0 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 -1 -1 0 
-1 -1 -1 0 -1 -1 -1 -1 -1 -1 
-1 1 0 -1 -1 1 -1 -1 -1 -1 
-1 -1 -1 0 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 1 -1 0 
-1 -1 1 -1 0 -1 -1 -1 -1 -1 
-1 -1 -1 0 -...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
10 19
-1 -1 -1 -1 1 -1 0 -1 -1 -1 
-1 -1 -1 -1 0 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 -1 -1 0 
-1 -1 -1 0 -1 -1 -1 -1 -1 -1 
-1 1 0 -1 -1 1 -1 -1 -1 -1 
-1 -1 -1 0 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 1 -1 0 
-1 -1 1 -1 0 -1 -1 -1 -1 -1 
-1 -1 -1 0 -...

output:

11aafa73e7e6b339b273565a5bb47429
200
10 19
10 19
10 18
10 19
10 18
10 18
10 18
10 19
10 18
10 19
10 18
10 19
10 19
10 18
10 18
10 19
10 18
10 19
10 16
10 18
10 19
10 19
10 18
10 18
10 19
10 15
10 16
10 19
10 17
10 18
10 19
10 19
10 19
10 18
10 19
10 17
10 19
10 18
10 19
10 19
10 13
10 17
10 19
10 19...

result:

ok Correct

Test #44:

score: 53
Accepted
time: 11ms
memory: 5248kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
20
1 1 1 1 0 1 1 1 0 1 1 1 0 0 1 1 0 1 1 0
0 0 1 1 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 1 0 0 0 1 0 0 1 1 0 0 0 1 0 1 0 0
0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0
0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0
1 1 1 1 0 ...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
20 38
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 0 -1 -1 
1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 
-1 -1 -1 -...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
20 38
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 0 -1 -1 
1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 
-1 -1 -1 -...

output:

11aafa73e7e6b339b273565a5bb47429
200
20 38
20 38
20 38
20 39
20 37
20 38
20 37
20 39
20 39
20 35
20 39
20 38
20 39
20 39
20 36
20 39
20 39
20 36
20 39
20 39
20 38
20 39
20 39
20 37
20 39
20 39
20 38
20 39
20 37
20 38
20 39
20 39
20 39
20 39
20 39
20 39
20 39
20 36
20 37
20 38
20 39
20 39
20 39
20 39...

result:

ok Correct

Test #45:

score: 53
Accepted
time: 120ms
memory: 16896kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 100
100
1 1 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 1 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 1 1 0 1 0 0 1 0 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 0 1 1 0 1 0
1 1 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 1 0 1 0 1 0 0 1...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 100
100 198
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 100
100 198
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1...

output:

11aafa73e7e6b339b273565a5bb47429
100
100 198
100 199
100 197
100 199
100 197
100 199
100 198
100 197
100 199
100 199
100 198
100 197
100 199
100 198
100 199
100 198
100 199
100 194
100 199
100 199
100 199
100 199
100 198
100 199
100 199
100 198
100 198
100 196
100 197
100 199
100 198
100 198
100 197...

result:

ok Correct

Test #46:

score: 53
Accepted
time: 117ms
memory: 18176kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 4
499
0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
499 997
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
499 997
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -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:

11aafa73e7e6b339b273565a5bb47429
4
499 997
499 996
499 995
499 997

result:

ok Correct

Test #47:

score: 53
Accepted
time: 113ms
memory: 18176kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 4
500
0 0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 1 0 1 0 0 1 1 1 1 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
500 997
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
500 997
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -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:

11aafa73e7e6b339b273565a5bb47429
4
500 997
500 999
500 999
500 999

result:

ok Correct

Test #48:

score: 53
Accepted
time: 87ms
memory: 15360kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 4
454
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
454 809
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
454 809
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -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:

11aafa73e7e6b339b273565a5bb47429
4
454 809
411 742
487 973
442 883

result:

ok Correct

Test #49:

score: 53
Accepted
time: 84ms
memory: 14464kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 4
467
0 0 0 1 0 0 1 1 0 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 0 1 1 0 0 0 0 1 1 0 1 0 0 0 0 1 1 0 1 1 0 1 0 0 0 1 0 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
467 933
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 4
467 933
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -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:

11aafa73e7e6b339b273565a5bb47429
4
467 933
437 872
416 830
412 823

result:

ok Correct

Test #50:

score: 53
Accepted
time: 46ms
memory: 9472kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
47
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 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:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
47 47
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
47 47
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -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:

11aafa73e7e6b339b273565a5bb47429
200
47 47
49 97
40 79
46 91
44 87
48 95
40 40
48 48
43 43
42 42
45 89
44 44
45 89
44 44
45 45
42 42
44 44
40 40
41 81
48 48
45 89
48 95
46 91
46 91
47 47
50 50
41 81
50 99
43 85
48 95
41 81
40 79
45 89
44 44
47 47
48 48
41 81
46 46
43 85
48 48
43 85
41 81
48 95
40 79...

result:

ok Correct

Test #51:

score: 53
Accepted
time: 49ms
memory: 9600kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
41
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 0 ...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
41 81
-1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
41 81
-1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -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:

11aafa73e7e6b339b273565a5bb47429
200
41 81
48 48
50 99
49 91
43 85
44 70
46 60
48 95
49 97
42 83
44 56
40 78
40 79
49 97
45 89
42 44
50 50
41 81
46 91
43 78
44 50
44 73
40 79
41 63
48 88
47 47
50 91
49 97
46 73
42 65
48 95
43 43
45 64
43 43
41 81
45 62
50 99
48 48
42 64
43 43
44 66
43 70
49 49
40 79...

result:

ok Correct

Test #52:

score: 53
Accepted
time: 50ms
memory: 9728kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
41
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1
1 1 ...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
41 81
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
41 81
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -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:

11aafa73e7e6b339b273565a5bb47429
200
41 81
47 93
40 66
49 79
49 96
47 91
43 85
44 87
47 93
41 69
45 86
41 75
46 91
44 87
41 81
44 86
43 83
43 84
48 88
48 95
49 97
48 91
48 94
43 85
44 87
40 79
47 93
48 67
40 66
42 69
43 78
43 79
49 97
42 83
45 70
44 81
48 95
40 79
41 67
47 88
50 97
46 90
46 88
44 81...

result:

ok Correct

Test #53:

score: 53
Accepted
time: 51ms
memory: 9728kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
44
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 0 0 0 0 0 1 0 0 1
1 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 ...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
44 87
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
44 87
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -...

output:

11aafa73e7e6b339b273565a5bb47429
200
44 87
41 81
41 61
48 91
45 85
47 93
49 96
44 87
42 83
50 99
41 80
40 74
45 86
40 76
41 73
44 87
48 94
40 79
49 97
44 86
40 79
42 71
46 91
43 84
40 72
46 89
49 93
42 83
44 87
42 83
48 79
44 87
44 87
43 79
49 95
47 93
44 86
43 85
46 83
46 91
43 80
49 97
49 89
42 81...

result:

ok Correct

Test #54:

score: 53
Accepted
time: 53ms
memory: 9728kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
47
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 0 1 1 1 0 1 0 0 1 1 0 0 1 0 1 1 1 0 1 1 0 0 1 1 0 1 0 0 0 1 1
0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 ...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
47 89
-1 -1 -1 -1 -1 0 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 ...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
47 89
-1 -1 -1 -1 -1 0 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 ...

output:

11aafa73e7e6b339b273565a5bb47429
200
47 89
47 92
44 86
48 93
45 89
47 91
45 89
50 98
44 86
45 89
48 95
40 79
43 85
46 91
43 85
42 83
50 98
46 90
42 83
49 96
47 93
46 90
47 91
43 84
46 86
42 83
45 84
47 93
47 93
47 92
50 99
40 77
45 89
49 97
45 83
49 95
47 93
45 88
47 93
49 97
44 87
42 83
43 84
44 87...

result:

ok Correct

Test #55:

score: 53
Accepted
time: 5ms
memory: 4224kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
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 0 1 1 1 1 1 1 0 0 1 1 1 1 1
1 1 1 1 1 1 0 1 1 1 1 1 1 0 0 1 1 1 1 1
1 1 1 1 1 1 0 1 1 1 1 0 0 0 0 0 1 0 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1
0 0 1 1 1 1 0 1 1 1 0 0 0 0 0 0 1 0 1 1
1 1 1 1 1 ...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
20 39
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 1 -1 -1 -1 -1 -1 0 -1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 1...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
20 39
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 1 -1 -1 -1 -1 -1 0 -1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 
-1 -1 -1 1...

output:

11aafa73e7e6b339b273565a5bb47429
200
20 39
9 17
12 23
6 10
14 26
5 9
12 22
10 19
12 17
6 11
7 13
1 1
19 37
12 18
11 20
2 3
16 29
3 4
17 28
4 7
2 3
13 23
9 16
14 27
4 7
2 3
17 33
4 4
9 17
16 31
18 34
5 8
19 35
6 11
9 17
5 7
9 16
9 13
12 23
18 35
13 21
8 15
2 3
18 35
9 17
15 27
20 37
5 9
19 35
2 3
16 ...

result:

ok Correct

Test #56:

score: 53
Accepted
time: 4ms
memory: 4480kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 200
12
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 ...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
12 12
-1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 200
12 12
-1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1 -1 
-1 -1 -1 -1 -1 -1 -1 0 -1 -1 -1...

output:

11aafa73e7e6b339b273565a5bb47429
200
12 12
19 19
5 9
12 12
14 27
4 4
3 3
11 11
13 25
17 33
6 11
17 17
9 9
18 35
14 27
12 12
6 6
11 11
4 4
17 33
18 18
18 18
12 12
14 27
4 4
17 33
12 12
15 29
14 27
9 17
4 7
20 39
7 13
12 23
19 19
18 35
3 3
20 39
13 13
13 13
15 15
9 17
8 8
5 5
11 21
12 12
9 9
11 21
9 9...

result:

ok Correct

Test #57:

score: 53
Accepted
time: 40ms
memory: 8448kb

input:

3905dde5ebb4c3c616c4aecc3a7e1801ce17df70
1 100
1
0
0
0
2
1 0
1 1
0 1
0 1
3
1 1 1
1 0 1
1 1 1
2 0 1
1 0 2
4
0 0 0 0
0 0 0 0
1 0 0 0
0 0 0 0
3 2 1 0
1 3 2 0
5
1 1 1 1 1
1 1 1 1 1
1 0 1 1 1
1 1 1 1 1
1 1 1 1 1
4 3 1 2 0
4 1 3 2 0
6
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 1
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0...

output:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 100
1 1
0 
0 
2 3
1 0 
-1 1 
1 0 
1 1 
3 4
0 1 1 
-1 -1 -1 
1 -1 -1 
0 1 1 
1 1 1 
1 1 1 
4 5
-1 0 -1 -1 
0 1 -1 -1 
-1 0 -1 -1 
-1 0 -1 -1 
0 0 0 0 
0 1 0 0 
0 0 0 0 
0 0 0 0 
5 6
-1 -1 -1 -1 -1 
1 0 1 1 1 
-1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 
-1 1 -1 -1 -1 
1 ...

input:

d3b2d22d83a3562bdeed51c04fea59d39d2aa5f0
2 100
1 1
0 
0 
2 3
1 0 
-1 1 
1 0 
1 1 
3 4
0 1 1 
-1 -1 -1 
1 -1 -1 
0 1 1 
1 1 1 
1 1 1 
4 5
-1 0 -1 -1 
0 1 -1 -1 
-1 0 -1 -1 
-1 0 -1 -1 
0 0 0 0 
0 1 0 0 
0 0 0 0 
0 0 0 0 
5 6
-1 -1 -1 -1 -1 
1 0 1 1 1 
-1 -1 -1 -1 -1 
-1 -1 -1 -1 -1 
-1 1 -1 -1 -1 
1 ...

output:

11aafa73e7e6b339b273565a5bb47429
100
1 1
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 47
47 4...

result:

ok Correct