#abc250f. F - One Fourth

F - One Fourth

Score : 500500 points

问题描述

ABC 250 对于目标举办 ABC 1000 的高桥来说是一个值得纪念的四分之一里程碑,因此他打算通过尽可能接近吃掉所买披萨的 1/41/4 来庆祝这次比赛。

高桥购买的披萨呈平面凸 NN 边形形状。当披萨放在 xyxy 平面上时,第 ii 个顶点的坐标为 (Xi,Yi)(X_i, Y_i)

高桥决定按照以下方式切割并食用披萨:

  • 首先,高桥从披萨的顶点中选择两个不相邻的顶点,并沿过这两点的直线用刀进行切割,将披萨分割成两块。
  • 然后,他任意选择其中一块食用。

aa 为高桥所购披萨面积的四分之一(=1/4=1/4),bb 为高桥所吃披萨的那一块面积。求 8×ab8 \times |a-b| 可能达到的最小值。可以证明这个值始终为整数。

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

ABC 250 is a commemorable quarter milestone for Takahashi, who aims to hold ABC 1000, so he is going to celebrate this contest by eating as close to 1/41/4 of a pizza he bought as possible.

The pizza that Takahashi bought has a planar shape of convex NN-gon. When the pizza is placed on an xyxy-plane, the ii-th vertex has coordinates (Xi,Yi)(X_i, Y_i).

Takahashi has decided to cut and eat the pizza as follows.

  • First, Takahashi chooses two non-adjacent vertices from the vertices of the pizza and makes a cut with a knife along the line passing through those two points, dividing the pizza into two pieces.
  • Then, he chooses one of the pieces at his choice and eats it.

Let aa be the quarter (=1/4=1/4) of the area of the pizza that Takahashi bought, and bb be the area of the piece of pizza that Takahashi eats. Find the minimum possible value of 8×ab8 \times |a-b|. We can prove that this value is always an integer.

Constraints

  • All values in input are integers.
  • 4N1054 \le N \le 10^5
  • Xi,Yi4×108|X_i|, |Y_i| \le 4 \times 10^8
  • The given points are the vertices of a convex NN-gon in the counterclockwise order.

Input

Input is given from Standard Input in the following format:

NN

X1X_1 Y1Y_1

X2X_2 Y2Y_2

\dots

XNX_N YNY_N

Output

Print the answer as an integer.

Sample Input 1

5
3 0
2 3
-1 3
-3 1
-1 -1

Sample Output 1

1

Suppose that he makes a cut along the line passing through the 33-rd and the 55-th vertex and eats the piece containing the 44-th vertex.
Then, a=332×14=338a=\frac{33}{2} \times \frac{1}{4} = \frac{33}{8}, b=4b=4, and 8×ab=18 \times |a-b|=1, which is minimum possible.

Sample Input 2

4
400000000 400000000
-400000000 400000000
-400000000 -400000000
400000000 -400000000

Sample Output 2

1280000000000000000

Sample Input 3

6
-816 222
-801 -757
-165 -411
733 131
835 711
-374 979

Sample Output 3

157889

update @ 2024/3/10 10:41:39