luogu#P10859. [HBCPC2024] Nana Likes Polygons
[HBCPC2024] Nana Likes Polygons
题目描述
Nana’s electronic pet, MACARON, enjoys moving around in the room. Nana wants to create a boundedarea where MACARON can roam within.
The positions in the room can be represented using a two-dimensional coordinate system, and Nana provides a set of vertices on it. Nana likes polygons and now wants to select a subset of vertices that can form a convex polygon as its endpoints. However, Nana also wants to ensure that the selected area is not too big.
Thus, she is going to determine the minimum possible area of the convex polygon ending on a subset of given vertices. If such a convex polygon doesn’t exist, please output -1
(without quotes).
输入格式
The first line contains a single integer — the number of test cases.
For each test case, the first line contains a single integer — the number of given vertices.
The following lines each contain two integers, and the -th line contains — the coordinate of the -th vertex.
输出格式
For each test case, if no such convex polygon, please output -1
without quotes; otherwise output a single real number denoting the minimum possible area of the convex polygon ending on these given vertices.
Let and denote the answer and your output respectively. Your output will be accepted if the absolute or relative error of does not exceed . Formally, your output is accepted if and only if
2
4
0 -1
-3 0
0 2
2 2
3
-1 -1
0 0
1 1
2
-1
提示
For the first test case, choose , and as endpoints of a convex polygon with area . It can be proved that this is the minimized area in this case.
For the second test case, no convex polygon can be formed by these three vertices.