cf/mirror

Palindromic Paths

CF
1366C1500· specialist1.5s256 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
4
2 2
1 1
0 1
2 3
1 1 0
1 0 0
3 7
1 0 1 1 1 1 1
0 0 0 0 0 0 0
1 1 1 1 1 0 1
3 5
1 0 1 0 0
1 1 1 1 0
0 0 1 0 0
Output
0
3
4
4
1366C.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)