F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Enveloping Convex

Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 236    Accepted Submission(s): 42
Special Judge


Problem Description
You are given a convex polygon P and m points q1, q2, бн qm.
You need to find the minimum enveloping convex Q which is homologous with convex P and every opposite side of two polygons are parallel. Here, minimum enveloping convex Q means that it contains m points q1, q2, бн, qm (inside or on the border).
 

Input
The first line contains an integer T (<=30) denoting the number of test cases.
The first line of each test case contains an integer n (3 <= n <= 50000, sum of n overall test cases <= 100000) denoting the number of vertices of convex P.
Each of the next n lines contains two integers x and y denoting the coordinate of vertex Pi in clockwise or anticlockwise order. No 3 consecutive vertices lie in one line.
The next line contains an integer m (1 <= m <= 100000, sum of m overall test cases <= 300000) denoting the number of given points. Each of the next m lines contains the coordinate of point qi. Two points qi and qj (i != j) may have the same coordinates.
Absolute values of all coordinates are equal or less than 1000000.
 

Output
You must output minimum similitude ratio of convex Q to convex P.
Your answer will be considered correct if the absolute or relative error is less than 10-5.
 

Sample Input
1 3 0 0 0 1 1 0 4 1 0 0 1 -1 0 0 -1
 

Sample Output
3.0000000000
 

Hint


 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-29 13:30:32, Gzip enabled