cf/mirror

A Growing Tree

CF
1891F2000· candidate master2s256 MB⌨ stdin/stdout

Examples

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