cf/mirror

Maximum Distributed Tree

CF
1401D1800· expert2s256 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
3
4
1 2
2 3
3 4
2
2 2
4
3 4
1 3
3 2
2
3 2
7
6 1
2 3
4 6
7 3
5 1
3 6
4
7 5 13 3
Output
17
18
286
1401D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…