Particle swarm optimization ( PSO ) is a population-ba
Now there are n particles on the star-topology. Among the n particles, there is one particle as the leader, and there is an edge between the other particles and the leader. For a piece of information, it can be propagated along an edge on the topology.
To examine the benefits of this topology, we need to calculate the following data:
We define that X is number of edges required for them to exchange information for two different particles. Please calculate the expected value and maximum value of X.
The first line of input is a positive integer T(T≤10^5) representing the number of test cases.
For each line,input a number n(2≤n≤10^9).
2
4
7
1.500000000 2.000000000
1.714285714 2.000000000