| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 (추가 시간 없음) | 1024 MB | 24 | 10 | 7 | 43.750% |
Your roommate is planning some weekend projects to make your yard look better. The plan is to buy some plants. Your roommate wants to spend at least L dollars and at most H dollars. There are three different types of plants: cheap, normal, and expensive. Unfortunately, you cannot tell the difference by just looking at a plant. You know that each type has a different cost, and you know how many of each type your local nursery has in stock.
Now you are spending your time walking through the nursery aisles, picking out a plant, bringing it over to be rung up by the clerk, and praying that you stay within your desired total cost (your allotted budget). If you are not within your desired total cost (i.e., if your total cost is too low or too high), your roommate will get frustrated.
Given the cost and number of each plant type along with your desired budget range, determine the probability that you can buy plants one at a time and staying within your total cost range.
The first input line contains two integers: L and H (1 ≤ L ≤ H ≤ 109), representing the low and high end of the budget, respectively.
The second input line contains three integers: C, N, and E (1 ≤ C < N < E ≤ 109), representing the cost of the cheap, normal, and expensive plants, respectively.
The third input line contains three integers: c, n, and e (1 ≤ c, n, e ≤ 100), representing the number of cheap, normal, and expensive plants, respectively.
Print the probability that you will successfully complete the purchase within the desired budget by choosing plants one at a time. Your answer will be accepted if it is within 10-6 of the correct answer.
30 60 5 15 70 3 1 1
0.2
40 60 5 15 70 3 1 1
0.0