{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"A bird was flying on a train line, singing and passing lazy times. After a while it saw a train coming from its behind, so, it speeded up a bit, but remained calm. After a while, it saw another train coming towards it from the front side. The bird remained calm thinking that the train coming towards him would be on another line. But it realized soon after that both the trains were on the same line!\n\nSo, the stupid-brave bird made a plan to stop the accident. It flew towards the train which was coming from the front side, and after touching the train the bird turned back immediately and flew back until it could touch the other train. And after that, it turned back and continued this procedure. The birds\u0027 intention was to signal the drivers such that they could stop the train.\n\nWhen the trains were **d** meter way, the drivers realized the abnormal behavior of the strange bird and saw the opposite trains, and both drivers braked hard! They were able to stop the collision, but they managed to stop in front of each other leaving no space. A thousand lives saved, but the bird couldn\u0027t save itself!\n\nFor simplicity, we denote the train (that was behind the bird) as the left train and the other one as the right train. The left train had velocity **v\u003csub\u003e1\u003c/sub\u003e** **m/s** (meter per second) and the right train had velocity **v\u003csub\u003e2\u003c/sub\u003e** **m/s** and they saw each other when they were **d** meter away. The driver in the left train made a deceleration of **a\u003csub\u003e1\u003c/sub\u003e** **m/s\u003csup\u003e2\u003c/sup\u003e** and the driver in the right train made a deceleration of **a\u003csub\u003e2\u003c/sub\u003e** **m/s\u003csup\u003e2\u003c/sup\u003e**. And the trains just avoided the collision. That means they just stopped when their distance was **0** meter. The bird had a constant velocity of **v\u003csub\u003e3\u003c/sub\u003e m/s**. And assume that the bird can turn immediately and can keep its constant velocity. When the trains were **d** meter away, the bird was somewhere between the trains. Your task is to find the distance covered by the brave bird (from this moment) in meters before sacrificing its life for the thousand lives."}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026le; 100)**, denoting the number of test cases.\n\nEach case starts with a line containing five positive real numbers: **v\u003csub\u003e1\u003c/sub\u003e v\u003csub\u003e2\u003c/sub\u003e v\u003csub\u003e3\u003c/sub\u003e a\u003csub\u003e1\u003c/sub\u003e a\u003csub\u003e2\u003c/sub\u003e (v\u003csub\u003e1\u003c/sub\u003e \u0026lt; v\u003csub\u003e3\u003c/sub\u003e, v\u003csub\u003e2\u003c/sub\u003e \u0026lt; v\u003csub\u003e3\u003c/sub\u003e)**. No real number will be greater than **1000**. And no number contains more than three digits after the decimal point."}},{"title":"Output","value":{"format":"MD","content":"For each case, print the case number, **d** and the distance covered by the bird. Errors less than **10\u003csup\u003e-6\u003c/sup\u003e** will be ignored."}},{"title":"Sample","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\u003e1\n0.5 1.0 2 0.25 0.5\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase 1: 1.5000000000 4.0000000000\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}