题目描述
Read problems statements in Mandarin Chinese and Russian.
Chef and his friend Yurii decided to meet in the cafe. As they are very busy one would not wait for another too long. Namely, after arriving, Chef will spend at most t_{1} seconds waiting for Yurii while Yurii will wait no more than t_{2} seconds.
Chef can arrive at any moment within [0..T_{1}] with equal probability. Similarly Yurii can arrive at any moment within [0..T_{2}].
Arrival time may be any real number from the interval.
Chef asks you to calculate the probability of meeting his friend Yurii in the cafe.
------ Input ------
First line of the input contains an integer T denoting the number of test cases. First and the only line of each test case contains four space-separated integers – T_{1}, T_{2}, t_{1} and t_{2}.
------ Output ------
For each test case, output one the single real number - probability of meeting Chef and his friend Yurii. The answer will be considered correct if its absolute or relative error doesn't exceed 10^{-6}.
------ Constraints ------
$1 ≤ T ≤ 10^{5}$
$1 ≤ T_{1}, T_{2} ≤ 10^{9} $
$0 ≤ t_{1}, t_{2} ≤ 10^{9} $
Subtask 1: (5 points)
$t_{1} = 0 and t_{2} = 0$
Subtask 2: (15 points)
$t_{1} = 0 or t_{2} = 0$
Subtask 3: (25 points)
$1 ≤ T ≤ 5$
$1 ≤ T_{1}, T_{2} ≤ 10$
$The answer will be considered correct if its absolute or relative error doesn't exceed 10^{-2}$
Subtask 4: (55 points)
$Original constraints$
----- Sample Input 1 ------
2
2 2 1 1
1 1 1 1
----- Sample Output 1 ------
0.750000
1.000000
输入格式
见题面
输出格式
见题面