1685. Cover an Arc

单点时限: 2.0 sec

内存限制: 256 MB

A huge dancing-hall was constructed for the Ural State University’s 80-th anniversary celebration. The size of the hall is 2000 × 2000 metres! The floor was made of square mirror plates with side equal to 1 metre. Then the walls were painted with an indelible paint. Unfortunately, in the end the painter flapped the brush and the beautiful mirror floor was stained with the paint. But not everything is lost yet! The stains can be covered with a carpet.

Nobody knows why, but the paint on the floor formed an arc of a circle (a centre of the circle lies inside the hall). The dean of the Department of Mathematics and Mechanics measured the coordinates of the arc’s ends and of some other point of the arc (he is sure that this information is quite enough for any student of the Ural State University). The dean wants to cover the arc with a rectangular carpet. The sides of a carpet must go along the sides of the mirror plates (so, the corners of the carpet must have integer coordinates).

You should find the minimal square of such a carpet.

输入格式

consists of six integers. At first the coordinates of the arc’s ends are given. The co-ordinates of an inner point of the arc follow them. Absolute value of coordinates doesn’t exceed 1000. The points don’t belong the same straight line. The arc lies inside the square [-1000,1000]^2.

输出格式

You should write to an output file the minimal square of the carpet covering this arc.

样例

Input
476 612
487 615
478 616
Output
66

4 人解决,6 人已尝试。

4 份提交通过,共有 10 份提交。

7.6 EMB 奖励。

创建: 16 年,7 月前.

修改: 6 年,8 月前.

最后提交: 9 月,2 周前.

来源: Ural

题目标签