There is this PRO in our batch named Raghvesh. He is well known for his DANGEROUS PJ's. Dude, when i say DANGEROUS i really mean it. You won't wanna hear any of those. Unfortunately, we in our circle have to handle those every day.
One day Shikhar Sharad got an idea to end it for once and all. He framed a challenge which if Raghvesh loses, he would swear not to do KC with any of his PJ's ever again. As Shikhar knew, Raghvesh loves Maths a lot :P, so he decided to pose a mathematical challenge. He placed N coins on the table with all heads up. Then he wrote K numbers on a piece of paper. ith number refers to the number of coins Raghvesh can randomly choose and reverse them upside down in the ith round. So, Raghvesh has to tell expected number of heads after K rounds.
Now the thing is that there is a timer of 2 minutes. If Raghvesh gives the answer to the puzzle within 2 minutes he wins otherwise he loses. But, he would not accept his defeat if Shikhar also cant answer the puzzle within the same stipulated time. Help Shikhar and all of us from Raghvesh's deadly jokes.
The first line of input is the number of test cases T. Each test case begins with an integer N, the number of coins. The next line contains the integer K, the number of rounds. The last line of the test case contains K integers, ith integer, a[i] being the number of coins to be randomly chosen and reversed in the ith round.
The expected number of heads at the end of K rounds correct upto 6 decimal places.
10 10 10
2 7 1 8 2 8
916 153 357 729 183 848 61 672 295 936
Problem Setter: Dhruva Bhaswar