Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register
Language:
Rotated Sky Charts
Time Limit: 2000MSMemory Limit: 131072K
Total Submissions: 474Accepted: 35

Description

Lambert has two scanned images of a sky chart. These two images look identical except that they are rotated and scaled with different parameters with respect to the same center. Lambert wants to know the smallest angle one of the images has to be rotated so that the two images coincide if appropriately scaled.

Input

The input contains multiple test cases. Each test case begins with a line containing a positive integer n (1 ≤ n1 000 000), the number of stars shown in each image. Then comes 2n lines each containing a pair of real numbers (x, y), the position of a star in an image. The first n lines describe the first image; the rest describe the second image. The input ends once EOF is met.

Output

For each test case, output one line containing the smallest angle the first image has to be rotated counterclockwise so that the two images coincide if appropriately scaled. Output your result in degrees and round it to two digits beyond decimal point.

Sample Input

1
1 0
0 100
2
1 1
-1 1
1 -1
-1 -1
5
-19830.82380 -18786.25720
2148.03095 -18081.71419
875.00326 -22561.64828
7119.42127 8980.47085
-8967.62588 37.09588
24112.04526 12837.22343
2737.01862 18001.97639
5155.38703 21982.16524
-9250.95629 -6764.23120
8634.96079 -2420.15335

Sample Output

90.0
180.00
164.58

Source

[Submit]   [Go Back]   [Status]   [Discuss]

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator