#000171

z-spaghetti

Little Z has N spaghetti on his rectangular paper plate of size W by H. Where, 1 <= N <= 10000, and W = H = 2000000.

He wants to cut the plate into two parts so that he divides the sum of the length of the remaining spaghetti into two equal parts.

The spaghetti can intersect, overlap, etc...

Hi is cutting it he way that the knife touches the coordinate 0,0 (bottom left corner of the plate), and the knife makes some angle alpha with respect to the plate's coordinate system.

He asks you to find the minimal value of the angle, in degrees for which the total length of the both parts of the cut plate will be equal. He wants the solution in degrees with 2 decimal points accuracy.


InputFrom the first line of the standard input read an integer N representing the number of spaghetti. From the next N lines read four integers x1,y1,x2, y2 representing the starting and the ending coordinate of each of the spaghetti. All the coordinates will be inside the plate

OutputTo the standard output, write the desired minimal angle with two decimal point accuracy.

Input:
1
1 0 0 1

Output:
45.00

Input:
2
2 0 2 1
1 2 2 2

Output:
26.57

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.