ZCR  Zen And His Crush
Zen has a Crush and is always fantasizing about her. He is so restless now, that he has decided to meet her and express his immense feelings about her. He fears a lot of being rejected that's why he wants to examine his luck. Zen has N biased coins where the probability of getting Head from ith coin is Pi. His luck of being accepted is the probability of getting exactly K heads when N coins are tossed simultaneously.
Zen is weak in programming and asking for help. Can you help him to calculate his luck?
Input
First Line of the input file contains, Tnumber of test cases. (1<=T<=100)
Each test case followed by two integers, N and K. (1<=N<=1000 && 0<=K<=N)
Next line contains Nspace separated real values, Pi.
Output
For each test case, you have to print desired output(up to 10 decimal places).
Example
Input: 1
3 2
0.0 0.5 1.0 Output: 0.5000000000
hide comments
shreyas_07:
20201205 05:21:47
take care of edge case 

mahmoud_hossam:
20180809 17:18:40
شىء سىء


mahmoud_hossam:
20180809 16:58:00
i could do it using branching in 0.00s :> 

mahmoud_hossam:
20180809 16:57:33
k k k 

nadstratosfer:
20171128 20:17:17
Protip: expressing immense feelings is counterproductive when trying to get a head, especially when one has coins to toss ;) 

mahilewets:
20170902 16:26:41
The solution immediately comes to mind after reading the statement. 

wisfaq:
20170328 09:58:36
@anand25021998: I shouldn't know what is so special about k=0. 

anand25021998:
20170327 17:28:32
The testcases are weak I guess. I submitted 2 solns and both were accepted but in only one of them I took care of k=0.Hope u take notice of this 
Added by:  e_coder 
Date:  20170327 
Time limit:  0.5s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All 