cf/mirror

Growing Trees

CF
1951I3200· legendary gm5s512 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
4
5 5 1
4 3 5 5
2 1 5 7
2 4 6 2
5 3 3 5
2 5 2 9
5 5 3
4 3 5 5
2 1 5 7
2 4 6 2
5 3 3 5
2 5 2 9
2 1 10000000
1 2 1000 1000
10 15 10
7 1 7 6
5 8 6 6
4 8 2 2
4 3 10 9
10 8 3 4
4 6 6 1
5 4 1 3
9 3 4 3
8 3 9 9
7 5 10 3
2 1 3 4
6 1 6 4
2 5 7 3
10 7 2 1
8 2 6 8
Output
38
191
100000010000000000
2722
1951I.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…