题号:NC230995
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
Special Judge, 64bit IO Format: %lld
题目描述
In geometry, the polygonal chain, or polyline, is a connected series of points. The length of a polyline is the summation of lengths of all segments between adjacent points in the polyline.
In this problem, you're given a polyline defined by a series of points
)
,
)
,
)
,
)
, ...,
)
and
)
. You need to calculate the minimum length of the polyline after removing two points from
)
,
)
,
)
, ...,
)
. Note that after the removal, the remaining points are connected from left to right to form the new polyline.
输入描述:
The first line contains an integer
, representing the number of points between
and
.
The next line contains
integers
, representing the
coordinates of these points on the polyline.
,
.
输出描述:
Output one line with the minimum polyline length after removing two points. Your answer will be considered correct if the absolute or relative error is less than
.