Filling the Grid
1228B1400· specialist1s256 MB⌨ stdin/stdout
Examples
Sample 1of 3
Input
3 40 3 10 2 3 0
Output
2
Sample 2of 3
Input
1 101
Output
0
Sample 3of 3
Input
19 1616 16 16 16 15 15 0 5 0 4 9 9 1 4 4 0 8 16 126 12 19 15 8 6 19 19 14 6 9 16 10 11 15 4
Output
797922655
58%
1228B.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)