- You're lying, Kolya! There's no life on Mars! Who told you such nonsense?
- Petya. Sasha told him.
- Well, I've never heard a truthful word from Petya! He always twists everything. And how would Sasha know?
- Sasha heard it from Vladimir Alekseyevich, our biology teacher.
- Well, Vladimir Alekseyevich can be trusted... But it's unlikely he said that. Either Sasha or Petya made it up. Or maybe you're just pulling my leg?..
- Hold on a minute, guys, interrupted the approaching math teacher, Gleb Timofeyevich, let's approach the problem formally. Suppose all the conversations—Vladimir Alekseyevich with Sasha, Sasha with Petya, and Petya with Kolya—actually took place. Let's number the guys as , , and . Assume also that each of them independently transmits the information about life on Mars correctly with probability p_i, and lies with probability q_i = 1 - p_i for i = 1, 2, 3. Probabilities are real numbers from to ; an event with probability will never happen, while an event with probability will always happen. Knowing that Kolya then declares that there is life on Mars, find, based on the given p_i, the probability that Vladimir Alekseyevich really said so.
- How do we find this probability? And what does "independently" mean? – the kids were puzzled.
- Independence means that the actions of one of the guys do not affect how the others act. For example, it doesn't matter to Petya if Sasha lied – in any case, Petya will convey what Sasha said correctly with probability exactly p_2. The task is not difficult, and we can consider all eight possible cases. The first case is when all of the guys told the truth, and the probability of this case is p_1 \cdot p_2 \cdot p_3. In this case, there is undoubtedly life on Mars – we trust Vladimir Alekseyevich and the guys have transmitted his words correctly. The second case, when only Sasha lied, occurs with probability q_1 \cdot p_2 \cdot p_3, and in this case there is no life on Mars. Let us examine each of the six remaining cases in turn, multiplying the respective probabilities each time, and then sum the probabilities of those cases in which the teacher's words have been transmitted correctly. The fact that the probabilities for each individual are multiplied in each case is the formal definition of independence. So, in how many cases will exactly what Vladimir Alekseyevich said be conveyed?
- In one...
- Oh no. For example, if Petya and Kolya lied and Sasha told the truth, then the truth, having been distorted twice, will reach us unchanged. In general, an even number of negations applied to a statement gives the statement itself. In our task, there are four cases with an even number of negations, and the final probability is p_1 p_2 p_3 + q_1 q_2 p_3 + q_1 p_2 q_3 + p_1 q_2 q_3.
- So if Petya and Kolya definitely lie and Sasha definitely tells the truth, will we hear exactly what the teacher said from Kolya?
- Exactly right. Now solve the problem for the general case, where there are people instead of three. The first one to solve it gets an A on the next test!
The input file contains an integer (1 \le n \le 100). The second line contains real numbers separated by spaces – these are p_1, p_2, \ldots, p_n (0 \le p_i \le 1). Each number is given with no more than six decimal places.
Print to the output file one real number, rounded to six decimal places – the probability that there is life on Mars.
Example 1