Given probability of winning of yang12138 at each level. As a GrandMaster, please calculate the expected competition times of yang12138 to become a GrandMaster.
The first line of input contains an integer T, indicating the number of test cases.
For each test case there are two lines :
The first line contains an integer n.
The second line contains $n$ real numbers
, indicating the probability of winning when using an account at level i.
For each test case output a real number, rounded to 4 decimal places.