从前有个人叫【C_W_L】,他想在他家后花园盖了一个长方形游泳池(这是真的奢侈)
他在他家后花园弄了个坐标轴,然后画了几个点,结果他的朋友Morning_X过来搞鬼擦去了几个点。
现在已知剩下的n个点,请问你能否帮他恢复这个矩形
The first line of the input contains a single integer n (1 ≤ n ≤ 4) — the number of vertices that were not erased by Wilbur's friend.
Each of the following n lines contains two integers xi and yi ( - 1000 ≤ xi, yi ≤ 1000) —the coordinates of the i-th vertex that remains. Vertices are given in an arbitrary order.
It's guaranteed that these points are distinct vertices of some rectangle, that has positive area and which sides are parallel to the coordinate axes.
第一行有一个整数n (1 ≤ n ≤ 4) 。代表没被Morning_X擦去的点的数量。
接下来有n行,每行有2个整数xi 和 yi ( - 1000 ≤ xi, yi ≤ 1000) ,代表第i个顶点的坐标,顶点以任意顺序给出
保证这些点一定是不同的且矩形面积为正
Print the area of the initial rectangle if it could be uniquely determined by the points remaining. Otherwise, print - 1.
如果他可以唯一确定剩下的点则输出矩形的面积,如果不能则输出-1
2
0 0
1 1
1
1
1 1
-1
NoteIn the first sample, two opposite corners of the initial rectangle are given, and that gives enough information to say that the rectangle is actually a unit square.
In the second sample there is only one vertex left and this is definitely not enough to uniquely define the area.