cf/mirror

Grid Game

CF
1991I3500· legendary gm5s256 MB⇄ interactive

Examples

Sample 1of 1
Input
1
4 4
 
 
 
 
3 4
 
4 4
 
4 2
 
4 1
 
1 4
 
1 2
 
2 2
 
2 1
Output
2 3 4 10
12 6 11 15
5 13 16 8
9 7 1 14
 
2 4
 
4 3
 
3 3
 
3 1
 
1 3
 
1 1
 
2 3
 
3 2
1991I.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)