cf/mirror

Matrix Problem

CF
1913E2400· grandmaster1s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
3 3
0 0 0
0 0 0
0 0 0
1 1 1
1 1 1
Output
3
Sample 2of 3
Input
3 3
1 1 1
1 1 1
1 1 1
3 2 1
1 2 3
Output
3
Sample 3of 3
Input
2 2
0 0
0 0
1 2
0 1
Output
-1
1913E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…