cf/mirror

Apple Tree Traversing

CF
2107D2100· master5s512 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
6
4
1 2
1 3
1 4
4
2 1
2 4
2 3
5
1 2
2 3
3 4
4 5
1
8
6 3
3 5
5 4
4 2
5 1
1 8
3 7
6
3 2
2 6
2 5
5 4
4 1
Output
3 4 3 1 2 2
3 4 3 1 1 1
5 5 1
1 1 1
5 8 7 2 4 2 1 6 6
5 6 1 1 3 3
2107D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…