HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Kovrov IT > problem:


2010.I. 50257 - Galls village

Guest
• Discussion of problem (1)

Volume problems

• 2009.I. 50278 - ATM
• 2010.A. 50287 - Providers
• 2010.B. 50281 - Primes
• 2010.D. 50277 - Unusual Lottery
• 2010.E. 50664 - Polygons
• 2010.F. 50265 - Liars and Knights
• 2010.G. 50256 - Sequence
• 2010.H. 50282 - Coins
• 2010.I. 50257 - Galls village
• 2010.J. 50258 - String manipulations
• 2007.C. 50640 - Cubes
• 2007.D. 50271 - Factorial
• 2007.K. 50276 - Nice Floor
• 2007.A. 50671 - Phalanx
• 2007.B. 50270 - Bitsorting
• 2007.E. 50663 - Lights
• 2007.G. 50272 - Strange Numbers

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 3000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Автор: Кирилл Бутин, ПГУ.

As you know Caesar is a conqueror. He decided to occupy N villages in a very unusual way. Each day he chooses some nonempty subset of not conquered villages and tries to capture it. If he succeeds, those villages will pass into his possession, otherwise Caesar will leave them free (freedom for all subset, but only for that day). This process repeats on the next day until there is at least one not captured village. Any subset of villages can be chosen with equal probability. After choosing some subset, Caesar tries to capture villages one by one in any order.

Galls are living in the first village. Your task is to find the probability that someday all villages except it will be conquered.

Input
The first line contains one integer N (1 ≤ N ≤ 15) - the number of villages. The following N lines contain integer probabilities Pi - probability of capture of i-th village in percents (0 < Pi ≤ 100; 1 ≤ iN).

Output
Output a real number - the probability that someday only the first village will remain free. Answer should be accurate to 10-5.

Input 1 Output 1
2
100
100
0.333333333
Input 2 Output 2
3
28
62
96
0.503901145

Для отправки решений необходимо выполнить вход.

www.contester.ru