Bridges
In the Lemuria Country there are N islands connected by bridges. Between each two islands with numbers i and i+1 (1 ≤ i ≤ N-1) there are several parallel bridges. Among these bridges there are a_i stable, and the remaining b_i bridges are unstable. If one passes a stable bridge from island i, he reaches the island i+1. And if he passes an unstable bridge, then just before he reaches an opposite end of the bridge, it breaks (and since it is broken now, he will never consider it in the future), and the traveler falls in the stream, where the flow brings him to the island number 1.
We are staying in the island number 1. Our goal is to reach the island number N. We will use the following strategy: on each step we randomly select one of the bridges from the current island to the next one which is not yet broken and pass it. It is clear that if a_i > 0 for all i, then we will achieve our goal sometime.
The length of each bridge is 1. Find the average distance we will travel by bridges before we reach the island with number N if we follow the algorithm described above.
Input
The first line of the input contains an integer N (1 ≤ N ≤ 1000). The next N-1 lines contain the description of the bridges. The i'th line contains two integers a_i and b_i separated by single space, (1 ≤ a_i ≤ 1000, 0 ≤ b_i ≤ 1000). The total number of unstable bridges is less than or equal to 1000.
Output
Output should contain one real number - the answer to the problem. Absolute or relative error should be less than 10^{-9}.