While taking a walk through the woods, a group of Foxen have come upon a curious sight — a row of N wooden poles sticking straight up out of the ground! Who placed them there, and why? The Foxen have no clue.
Looking at the poles from the side, they can be modeled as vertical line segments rising upwards from a number line (which represents the ground), with the ith pole at distinct integral position Pi and having a real-valued height of Hi.
One of the Foxen, Ozy, is fascinated by the shadows being cast on the ground by the poles. The sun is shining down on the poles from some point very high up in the sky, resulting in infinitely many rays of light descending towards the number line at all possible positions along it, but all travelling in some uniform direction. Each ray of light stops travelling as soon as it comes into contact with either a pole or the ground. Any point on the ground which is incapable of being reached by rays of light (because they would get blocked by at least one pole before reaching that point) is considered to be covered in shadows.
The sunlight's direction can be described by a real value a, with absolute value no larger than 80, where a is the signed angle difference (in degrees) between the rays' direction and a vector pointing directly downwards. As an example, let's imagine that there's a single pole at position 50 and with a height of 100. If a = 45, then sunlight is shining diagonally down and to the right, meaning that the pole obstructs rays of light from being able to reach any points on the ground in the interval [50, 150], effectively casting a shadow with length 100 to the right. If a = -45, then sunlight is shining diagonally down and to the left, causing the pole to cast a shadow with 100 to the left instead (over the interval [-50, 50]). If a = 0, then sunlight is shining directly downwards onto the ground, resulting in the pole not casting any shadow.
Ozy is planning on returning by himself tomorrow in order to observe the poles again, but he doesn't know at what time of day he'll be able to make the trip. He does at least have it narrowed down to being within some interval of time, during which he knows that the sunlight's direction a will range from A and B, inclusive. Given that the sunlight's direction a will be a real number drawn uniformly at random from the interval [A, B] when Ozy visits the poles tomorrow, please help him predict the expected total length of ground which will be covered in shadows at that time.
Input begins with an integer T, the number of different sets of poles. For each set of poles, there is first a line containing the space-separated integers N, A, and B. Then N lines follow, the ith of which contains the integer Pi and the real number Hi separated by a space. The poles' heights are given with at most 4 digits after the decimal point.
For the ith set of poles, print a line containing "Case #i: " followed by a single real number, the expected length of ground which will be covered in shadows. Your output should have at most 10-6 absolute or relative error.
1 ≤ T ≤ 30
1 ≤ N ≤ 500,000
-80 ≤ A < B ≤ 80
0 ≤ Pi ≤ 1,000,000,000
1 ≤ Hi ≤ 1,000,000
The sum of N values across all T cases does not exceed 2,000,000.
In the first case, the sunlight's direction a is drawn uniformly at random from the interval [44, 46]. As described above, the length of ground covered in shadows when a = 45 is exactly 100. When a = 44, the shadow's length is ~96.57, and when a = 46, its length is ~103.55. However, note that its expected length for this distribution of possible a values is not equal to the average of those sample lengths.