Problem 3000 --Enveloping Convex

3000: Enveloping Convex

"
Time Limit $3$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $2$ 正确数量 $0$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签
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).
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.
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.
1
3
0 0
0 1
1 0
4
1 0
0 1
-1 0
0 -1
3.0000000000

推荐代码 查看3000 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$ $ms]
内存最少[$ $KB]
第一AC
第一挑战 淡意的温柔 590700 2020-06-05 08:29:27

赛题来源/所属竞赛 2019 Multi-University Training Contest 4 N/A

竞赛编号 竞赛名称 竞赛时间 访问比赛