Polar rectangles
Vasya has recently learned about the polar coordinate system, focusing on the concept of a polar rectangle. Consider a Cartesian plane where two concentric circles are drawn with their center at the origin. The region between these circles is known as a ring (illustrated in blue in the figure). Additionally, if two rays are drawn from the origin, the area swept by the first ray as it moves to the second is referred to as an angle (the area between these two rays, shown in green in the figure). A polar rectangle is defined as the intersection of a specific angle with a specific ring (highlighted in red in the figure).
You are given several polar rectangles. Your task is to find the area of their intersection. Note that the intersection of polar rectangles may consist of multiple parts.
Input
The first line contains an integer N - the number of rectangles (1 ≤ N ≤ 100000). The following N lines provide the descriptions of the rectangles. Each rectangle is described by a quadruple of real numbers r_1, r_2, φ_1, φ_2. Here, r_1 and r_2 represent the radii of the circles forming the ring (r_1 < r_2), and φ_1 and φ_2 denote the angles formed by the first and second rays with the x-axis, measured in radians. The area is swept from the first ray to the second in a counterclockwise direction (i.e., increasing angles), even if φ_1 > φ_2. All numbers are provided with up to six decimal places. The angles are within the half-open interval [0, 2π), and the radii do not exceed 10^6. It is guaranteed that φ_1 ≠ φ_2.
Output
Output a single number representing the area of the desired intersection. The answer will be considered correct if its absolute or relative error does not exceed 10^{-6}.