Generating tests is always a boring and error-prone task for problem setters.
Recently, Rikka set a problem on trees, and now, she wants to generate some tests for this problem. At this time, Rikka tries an unusual way to generate trees. To generate a tree of size n:
- Rikka sets vertex 1 as the root;
- For the i-th (i>1) vertex, let
be all factors of i where
. Rikka uniformly randoms an integer j from [1, k-1], and sets vertex
as the father of vertex i.
Clearly, the result of this process must be a valid tree.
Now, Rikka wants to verify whether the generated tests are strong enough. For a tree T of size n, she defines its complexity c(T) as :
%20%3D%20%5Csum_%7Bi%3D1%7D%5En%20%5Csum_%7Bj%3D1%7D%5En%20%5Ctext%7Bdis%7D(T%2Ci%2Cj))
where
)
is the number of edges in the path from vertex i to vertex j on tree T.
Rikka wants you to calculate the expectation of c(T).