cf/mirror

Puzzle

CF
2111F2400· grandmaster2s512 MB⌨ stdin/stdout

Examples

Sample 1of 2
Input
2
1 1
31 4
Output
20
3 7
3 8
6 4
6 5
3 5
4 4
4 5
4 3
3 4
5 3
5 4
5 7
3 6
4 6
5 5
5 6
4 7
4 8
6 6
6 7
-1
Sample 2of 2
Input
2
4 2
12 5
Output
24
-7 2
-3 -3
-7 -5
-7 1
-3 2
-7 -2
-3 -5
-7 -6
-5 -6
-3 -4
-3 -6
-7 0
-6 -6
-7 -3
-5 2
-7 -1
-3 1
-4 -6
-3 0
-7 -4
-6 2
-4 2
-3 -1
-3 -2
5
0 0
0 1
1 0
-1 0
0 -1
2111F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)