Im trying to solve this problem but im getting WA. So, i dont know if i dont understand something in the statement problem, im missing something, i have a(or more than one) bug, ...
So, in order to try clear my doubts, could anyone give the correct output for this test cases, and even better could be if anyone give some extra test cases.
Code: Select all
3 3
6
0 0 1 0
1 0 0 0
1 0 2 0
0 1 0 2
1 2 0 2
1 2 2 2
2
2 1 1
4 2 1
4 2
10
1 0 0 0
0 1 0 0
1 1 1 0
0 2 1 2
1 2 0 2
1 1 0 1
0 3 0 2
1 3 1 2
1 3 0 3
1 2 1 1
5
1 1 0
2 0 2
3 1 2
4 0 3
5 1 3
1 1
0
0
1 2
0
4
1 1 0
2 1 0
3 1 0
4 1 0
4 1
3
0 1 0 0
0 2 0 1
0 3 0 2
2
2 0 2
3 0 1