Expected diameter of a tree
804D2500· grandmaster3s256 MB⌨ stdin/stdout
Examples
Sample 1of 2
Input
3 1 21 33 12 3
Output
-12.0000000000
Sample 2of 2
Input
5 2 32 44 34 24 12 5
Output
-12.66666666672.6666666667
58%
804D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…