cf/mirror

Numbers on the Chessboard

CF
1027B1200· pupil1s256 MB⌨ stdin/stdout

Examples

Sample 1of 2
Input
4 5
1 1
4 4
4 3
3 2
2 4
Output
1
8
16
13
4
Sample 2of 2
Input
5 4
2 1
4 2
3 3
3 4
Output
16
9
7
20
1027B.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)