eolymp
bolt
Try our new interface for solving problems
Problems

Laser Shooting

Laser Shooting

There is a laser cannon at coordinates (\textbf{0}, \textbf{0}) on the cartesian plane. There are also several targets on the plane. Each target is a vertical line segment, and the endpoints of the \textbf{i}-th target are at coordinates (\textbf{x_i}, \textbf{y1_i}) and (\textbf{x_i}, \textbf{y2_i}). A random angle between -\textbf{PI}/\textbf{2} and \textbf{PI}/\textbf{2}, inclusive, is chosen, and a single shot is fired. The angle -\textbf{PI}/\textbf{2} is straight down vertically, \textbf{0} is straight to the right horizontally, and \textbf{PI}/\textbf{2} is straight up vertically. A shot is a straight ray of infinite length starting from the point (\textbf{0}, \textbf{0}). A shot hits a target if there is a common point between them. Find the expected number of targets that will be hit by the single shot. Hitting a target doesn't change the direction of the laser shot. \InputFile Consists of multiple tests cases. The first line of each test case contains the number of targets \textbf{n} (\textbf{1} ≤ \textbf{n} ≤ \textbf{50}). Next thee line describe the targets coordinates. The \textbf{i}-th number of the second line of each test case contains the value of \textbf{x_i}, the \textbf{i}-th number of the third line contains the value of \textbf{y1_i}, the \textbf{i}-th number of the fourth line of each test case contains the value of \textbf{y2_i}. It is known that all the coordinates are integers, the values \textbf{x_i} are different, \textbf{1} ≤ \textbf{x_i} ≤ \textbf{1000}, \textbf{-1000} ≤ \textbf{y1_i}, \textbf{y2_i} ≤ \textbf{1000}. \OutputFile For each test case print in a separate line with \textbf{4} digits after the decimal point the expected number of targets that will be hit by the single shot.
Time limit 1 second
Memory limit 64 MiB
Input example #1
1
1	
-1	
1
4
134 298 151 942
-753 -76 19 568
440 689 -39 672
Output example #1
0.5000
1.4442