Problem: Andrey needs one more problem to conduct a programming contest. He has n friends who are always willing to help. He can ask some of them to come up with a contest problem. Andrey knows one value for each of his fiends — the probability that this friend will come up with a problem if Andrey asks him.

Help Andrey choose people to ask. As he needs only one problem, Andrey is going to be really upset if no one comes up with a problem or if he gets more than one problem from his friends. You need to choose such a set of people that maximizes the chances of Andrey not getting upset.

Input

The first line contains a single integer n (1 ≤ n ≤ 100) — the number of Andrey's friends. The second line contains n real numbers pi (0.0 ≤ pi ≤ 1.0) — the probability that the i-th friend can come up with a problem. The probabilities are given with at most 6 digits after decimal point.

Output

Print a single real number — the probability that Andrey won't get upset at the optimal choice of friends. The answer will be considered valid if it differs from the correct one by at most 10 - 9.

Examples

Input

4
0.1 0.2 0.3 0.8


Output

0.800000000000


Input

2
0.1 0.2


Output

0.260000000000

Note

In the first sample the best strategy for Andrey is to ask only one of his friends, the most reliable one.

In the second sample the best strategy for Andrey is to ask all of his friends to come up with a problem. Then the probability that he will get exactly one problem is 0.1·0.8 + 0.9·0.2 = 0.26.

Solution (in JAVA):

Solution:
import java.util.Arrays;
import java.util.HashSet;
import java.util.Random;
import java.util.Scanner;

public class CF253_D_Problem {

	public static void main(String[] args) {
		new CF253_D_Problem().run();
	}

	double[] f;

	public void run() {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		f = new double[N];
		for (int i = 0; i < N; i++) {
			f[i] = in.nextDouble();
		}

		// Generate data
		// int N = 20;
		// f = new double[N];
		// Random r = new Random();
		// for (int i = 0; i < N; i++) {
		// f[i] = r.nextDouble() * 0.2;
		// }

		// Reverse sort
		Arrays.sort(f);
		for (int i = 0; i < f.length / 2; i++) {
			double temp = f[i];
			f[i] = f[f.length - i - 1];
			f[f.length - i - 1] = temp;
		}

		// Consider taking the first N
		double P0 = 1;
		double P2 = 0;
		double Q = -1;
		double bestQ = 0;
		for (int i = 0; i < N; i++) {
			Q = 1 - P0 - P2;
			P0 = P0 * (1 - f[i]);
			P2 = P2 + Q * f[i];
			bestQ = Math.max(Q, bestQ);
		}
		Q = 1 - P0 - P2;
		bestQ = Math.max(Q, bestQ);

		explored = new HashSet<Key>();
//		backtrack(0, 1, 0, 0);

//		System.out.println(bestFound);
		System.out.println(bestQ);
	}

	double bestFound = 0;
	HashSet<Key> explored;

	public void backtrack(int ind, double P0, double P2, int nTaken) {

		double Q = 1 - P0 - P2;
		// System.err.printf("ind = %d  nTaken = %d   P0 = %.5f    P2 = %.5f    Q = %.5f   best = %.5f\n",
		// ind, nTaken,
		// P0, P2, Q, bestFound);
		// System.err.println(bestFound);
		if (P2 > (1 - bestFound)) {
			return;
		}

		// Key key = new Key(ind, P0, P2);
		// if (explored.contains(key)) {
		// return;
		// }

		if (Q > bestFound) {
			System.err.printf("Updating best from %.5f to %.5f at ind  = %d nUsed = %d\n", bestFound, Q, ind, nTaken);
			bestFound = Q;
		}
		// bestFound = Math.max(bestFound, Q);

		if (ind >= f.length) {
			return;
		}

		// Take this one
		backtrack(ind + 1, P0 * (1 - f[ind]), P2 + Q * f[ind], nTaken + 1);

		// Don't take this one
		backtrack(ind + 1, P0, P2, nTaken);

		// explored.add(key);
	}

	public class Key {

		int ind;
		double P0, P2;
		int hash;

		public Key(int ind, double P0, double P2) {
			this.ind = ind;
			this.P0 = P0;
			this.P2 = P2;
			this.hash = (ind << 12) ^ Double.valueOf(P0).hashCode() ^ Double.valueOf(P2).hashCode();
		}

		@Override
		public boolean equals(Object o) {
			if (!(o instanceof Key)) {
				return false;
			}

			Key other = (Key) o;

			return this.ind == other.ind && this.P0 == other.P0 && this.P2 == other.P2;
		}

	}
}