{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":" Andrew has just made a breakthrough in gambling: he has invented a way to make coins which have probability \u003ci\u003ep\u003c/i\u003e of landing heads-up and 1 - \u003ci\u003ep\u003c/i\u003e of landing tails-up when tossed, where \u003ci\u003ep\u003c/i\u003e is some number between 0 and 1. He can\u0027t, however, control the number \u003ci\u003ep\u003c/i\u003e itself, and creates coins with any \u003ci\u003ep\u003c/i\u003e from 0 to 1 with equal probability. That is, the value of \u003ci\u003ep\u003c/i\u003e is a random value uniformly distributed on \u003cimg src\u003d\"CDN_BASE_URL/20307c26aff0d52c97dbd817049e2312?v\u003d1719362563\" style\u003d\"vertical-align: text-bottom;top: -2.0px;max-width: 100.0%;max-height: 100.0%;\"\u003e. Andrew has generated two coins independently. One with probability \u003ci\u003ep\u003c/i\u003e and another with probability \u003ci\u003eq\u003c/i\u003e of landing heads-up. Random values \u003ci\u003ep\u003c/i\u003e and \u003ci\u003eq\u003c/i\u003e are both uniformly distributed on \u003cimg src\u003d\"CDN_BASE_URL/b22a0c32f42b86ad6320c9b9b7d5d3fe?v\u003d1719362563\" style\u003d\"vertical-align: text-bottom;top: -2.0px;max-width: 100.0%;max-height: 100.0%;\"\u003e and are independent. Of course, neither Andrew nor we know the numbers \u003ci\u003ep\u003c/i\u003e and \u003ci\u003eq\u003c/i\u003e, we can only try to guess them using our observations. The observations are the following: the first coin was tossed \u003ci\u003en\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e times, and \u003ci\u003em\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e of them landed heads-up. The second coin was tossed \u003ci\u003en\u003c/i\u003e\u003csub\u003e2\u003c/sub\u003e times, and \u003ci\u003em\u003c/i\u003e\u003csub\u003e2\u003c/sub\u003e of them landed heads-up. Your task is to compute the probability that \u003ci\u003ep\u003c/i\u003e \u0026lt; \u003ci\u003eq\u003c/i\u003e. \u003cbr\u003e\u003cdiv align\u003d\"left\" style\u003d\"margin-top: 1.0em;\"\u003e\u003cb\u003eInput\u003c/b\u003e\u003c/div\u003eThe first line of the input file contains one integer \u003ci\u003eT\u003c/i\u003e (\u003cimg src\u003d\"CDN_BASE_URL/62fa2d860eafe336087a746935af4ada?v\u003d1719362563\" style\u003d\"vertical-align: text-bottom;top: -2.0px;max-width: 100.0%;max-height: 100.0%;\"\u003e) — the number of test cases to solve. Each of the following \u003ci\u003eT\u003c/i\u003e lines contains 4 integers each: \u003ci\u003en\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e, \u003ci\u003em\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e, \u003ci\u003en\u003c/i\u003e\u003csub\u003e2\u003c/sub\u003e, \u003ci\u003em\u003c/i\u003e\u003csub\u003e2\u003c/sub\u003e. 1 ≤ \u003ci\u003en\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e, \u003ci\u003en\u003c/i\u003e\u003csub\u003e2\u003c/sub\u003e ≤ 1000, 0 ≤ \u003ci\u003em\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e, \u003ci\u003em\u003c/i\u003e\u003csub\u003e2\u003c/sub\u003e ≤ 50, 0 ≤ \u003ci\u003em\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e ≤ \u003ci\u003en\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e, 0 ≤ \u003ci\u003em\u003c/i\u003e\u003csub\u003e2\u003c/sub\u003e ≤ \u003ci\u003en\u003c/i\u003e\u003csub\u003e2\u003c/sub\u003e. \u003cbr\u003e\u003cdiv align\u003d\"left\" style\u003d\"margin-top: 1.0em;\"\u003e\u003cb\u003eOutput\u003c/b\u003e\u003c/div\u003eFor each test case output one line with a floating-point number, the probability of \u003ci\u003ep\u003c/i\u003e \u0026lt; \u003ci\u003eq\u003c/i\u003e. Your answer will be considered correct if it is within 10\u003csup\u003e-4\u003c/sup\u003e of the right answer. \u003cbr\u003e"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4\n2 1 4 3\n8 4 16 8\n2 0 6 1\n2 0 2 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0.7142857142\n0.5000000000\n0.5333333333\n0.8000000000\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}