405932: GYM102163 G Ali and the Breakfast
Description
Ali Mansour was having a breakfast with his friends at the dorm. He will pour tea in their cups. He wanted to make the breakfast more exciting, so he decided to throw a drop of tea at their cups.
Ali will throw the drop randomly from point $$$(0, 0)$$$ at a random (formally random) angle between $$$L$$$ and $$$R$$$ with initial speed $$$V$$$.
He has $$$N$$$ friends, and each has a cup of different width. Let's assume that each cup has a $$$0$$$ height and is placed on the ground (The $$$X$$$ Axis). Given each cup's position, for each cup calculate the probability that the drop will fall in this cup. Note: it's possible for two cups to overlap or intersect.
InputFirst line of input will be $$$T$$$ the number of test cases.
Each test case is described by $$$4$$$ space separated integers, $$$N, V, L, R$$$ ($$$ 1 \le N \le 1000 $$$), ($$$ 1 \le V \le 10^{9} $$$), ($$$ 0 \le L \le R \le 90 $$$).
Then $$$N$$$ lines, the positions of the cups ($$$X1_{i}$$$, $$$X2_{i}$$$), ($$$ 0 \le X1_{i} < X2_{i} \le 10^{9} $$$)
OutputFor each test case print $$$N$$$ lines. in the $$$I_{th}$$$ line print the probability that the drop will fall in the $$$I_{th}$$$ cup.
Print the probability rounded to exactly $$$4$$$ digits
ExampleInput1 5 15 30 45 16 21 21 22 22 30 10 15 1 40Output
0.2987 0.2979 0.4034 0.0000 1.0000Note
Consider $$$g$$$ = $$$10$$$ $$$m$$$.$$$s^{-2}$$$