+ محدودیت زمان: ۶ ثانیه
+ محدودیت حافظه: ۲۵۶ مگابایت
----------
Jenabkhan who has become billionaire from his Laboo bussiness, is now running for president. His country uses a strange mechanism, so-called electoral college, to select the president. There are several states in the country, and each state counts the votes independently. Depending on the population, each state has some members in the electoral college, and all of those members will vote the candidate with the majority of votes in their state. In the case of ties, each state has some tie-break rule to announce the clear winner. The president will be the candidate who receives more than half of votes in the electoral college.
Given the chance of Jenabkhan to win in each state, compute his winning probability in the electoral college.
# ورودی
The input consists of several test cases. Each test case starts with a line containing a single integer $n$ denoting the number of states ($1 \leq n \leq 1000$). Each of the next $n$ lines contains a real value $p_i$ with at most $4$ digits after the decimal point ($0 \leq p_i \leq 1$) and a positive integer $e_i$, specifying the winning probability of Jenabkhan in the $i$-th state and the number of electoral votes associated with that state, respectively. The total number of members in the electoral college is an odd number and is no more than $2000$. The input terminates with a line containing $0$ which should not be processed.
# خروجی
For each test case, output in a single line containing the winning probability of Jenabkhan, rounded to exactly four digits after the decimal point (e.g., $0.3000$ is correct while $0.3$ is not).
# مثال
## ورودی نمونه ۱
```
1
0.4 1
3
0.5 1
0.5 2
0.5 10
3
0.5 1
0.5 2
0.5 2
2
0.2 1
0.8 10
2
0.25 1
0.751 10
0
```
## خروجی نمونه ۱
```
0.4000
0.5000
0.5000
0.8000
0.7510
```