cf/mirror

Recover the Tree

CF
1710D3400· legendary gm3s256 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
3
4
1111
111
10
1
6
111111
11111
1111
111
11
1
12
100100000001
11100000001
1000000000
100000000
10010001
1110000
100000
10000
1001
111
10
1
Output
1 2
2 3
2 4
1 2
2 3
3 4
4 5
5 6
2 3
6 7
10 11
2 4
6 8
10 12
1 4
5 8
9 12
5 12
2 12
1710D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…