Codeforces Round 331 (Div. 2)
A
Wilbur and Swimming Pool
Codeforces
1100
原题
←B →
翻译中…

After making bad dives into swimming pools, Wilbur wants to build a swimming pool in the shape of a rectangle in his backyard. He has set up coordinate axes, and he wants the sides of the rectangle to be parallel to them. Of course, the area of the rectangle must be positive. Wilbur had all four vertices of the planned pool written on a paper, until his friend came along and erased some of the vertices.

翻译中…

Now Wilbur is wondering, if the remaining $*n*$ vertices of the initial rectangle give enough information to restore the area of the planned swimming pool.

翻译中…

Input

翻译中…

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 $*x*_{*i*}$ and $*y*_{*i*}$ ($- 1000 ≤ *x*_{*i*}, *y*_{*i*} ≤ 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.

翻译中…

Output

翻译中…

Print the area of the initial rectangle if it could be uniquely determined by the points remaining. Otherwise, print $- 1$.

翻译中…

Note

翻译中…

In 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.

翻译中…

样例

Input #1
2
0 0
1 1
Output #1
1
InputCopy OutputCopy
Input #2
1
1 1
Output #2
-1
InputCopy OutputCopy
题目信息
题号
596A
时间限制
1 s
内存限制
256 MB
标签
计算几何
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。