Rikka wants to generate an undirected graph with n vertices. It it clearly that there are
As a result, Rikka gets an undirected graph G. And then she chooses a vertex from all n vertices randomly with equal probability and calculates the length of the shortest path from the chosen vertex to n(the length of each edge is 1.) If the chosen vertex can not reach n, Rikka will set the answer to 109.
Anyway, at last Rikka will get an integer w, it may be 109, or may represent the length of some path in G. Now, Rikka wants you to calculate the expected value of

