| acmsguru |
|---|
| Finished |
. Andrew has generated two coins independently. One with probability p and another with probability q of landing heads-up. Random values p and q are both uniformly distributed on
and are independent. Of course, neither Andrew nor we know the numbers p and q, we can only try to guess them using our observations. The observations are the following: the first coin was tossed n1 times, and m1 of them landed heads-up. The second coin was tossed n2 times, and m2 of them landed heads-up. Your task is to compute the probability that p < q.
) — the number of test cases to solve. Each of the following T lines contains 4 integers each: n1, m1, n2, m2. 1 ≤ n1, n2 ≤ 1000, 0 ≤ m1, m2 ≤ 50, 0 ≤ m1 ≤ n1, 0 ≤ m2 ≤ n2. sample input | sample output |
4 2 1 4 3 8 4 16 8 2 0 6 1 2 0 2 1 | 0.7142857142 0.5000000000 0.5333333333 0.8000000000 |
| Name |
|---|


