// Arup Guha
// 12/10/08
// Solution to COP 3503H Contest II Problem: World Series

import java.util.*;
import java.io.*;

public class series {
	
	public static void main(String[] args) throws Exception {

		Scanner fin = new Scanner(new File("series.in"));
		
		int n = fin.nextInt();
		
		// Go through each case.
		for (int i=0; i<n; i++) {
			
			// Read in the input for this case.
			int numGames = fin.nextInt();
			
			double[] prob = new double[numGames];
			for (int j=0; j<numGames; j++)
				prob[j] = fin.nextDouble();
				
			System.out.printf("%.3f\n",solve(prob));
		}
		fin.close();		
	}
	
	public static double solve(double[] prob) {
		
		int needToWin = (prob.length+1)/2;
		
		// Here, the first dimension will represent our wins.
		// The second will represent the opponents' wins.
		double[][] allProb = new double[needToWin+1][needToWin];
		
		// Probability of this state is 1, it always happens.
		allProb[0][0] = 1;
		
		// The chance of winning each game in a row from the beginning
		// is dictated by each number in the prob array.
		for (int i=1; i<=needToWin; i++)
			allProb[i][0] = allProb[i-1][0]*prob[i-1];
			
		// The chance of losing each game in a row from the beginning 
		// is also dictated by each number in the prob array.
		for (int i=1; i<needToWin; i++)
			allProb[0][i] = allProb[0][i-1]*(1-prob[i-1]);
			
		// Loop through all possible states of the series (that matter).
		for (int i=1; i<=needToWin; i++) {
			for (int j=1; j<needToWin; j++) {
				
			
				// This is a special case, we must ensure that WE win the
				// last game of the series to prevent double counting. Thus,
				// if this is the last game we need to win, we DON'T add in
				// the probability of the other team winning it to get us 
				// there.	
				if (i == needToWin)
					allProb[i][j] = allProb[i-1][j]*prob[i-1+j];
				
				// For our team to win i games and the other to win j games,
				// the previous state was either (i-1,j) or (i,j-1). Namely,
				// from (i-1,j), we could have won, with prob[i-1+j].
				// OR from (i,j-1), they could have won, with 1-prob[i+j-1].
				else
					allProb[i][j] = allProb[i-1][j]*prob[i-1+j] +
								    allProb[i][j-1]*(1-prob[i+j-1]);
			}
		}
		
		// Add up all the different ways we can win the series!
		double sum = 0;
		for (int i=0; i<needToWin; i++)
			sum += allProb[needToWin][i];
		
		return sum;
		
	}
}