cf/mirror

Spiral Maximum

CF
173C1900· candidate master3s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
6 5
0 0 0 0 0
1 1 1 1 1
0 0 0 0 1
1 1 1 0 1
1 0 0 0 1
1 1 1 1 1
Output
17
Sample 2of 3
Input
3 3
1 1 1
1 0 0
1 1 1
Output
6
Sample 3of 3
Input
6 6
-3 2 0 1 5 -1
4 -1 2 -3 0 1
-5 1 2 4 1 -2
0 -2 1 3 -1 2
3 1 4 -3 -2 0
-1 2 -1 3 1 2
Output
13
173C.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)