cf/mirror

Balanced Removals (Harder)

CF
1237C21900· candidate master1s512 MB⌨ stdin/stdout

Examples

Sample 1of 2
Input
6
3 1 0
0 3 0
2 2 0
1 0 0
1 3 0
0 1 0
Output
3 6
5 1
2 4
Sample 2of 2
Input
8
0 1 1
1 0 1
1 1 0
1 1 1
2 2 2
3 2 2
2 3 2
2 2 3
Output
4 5
1 6
2 7
3 8
1237C2.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)