Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register
Language:
Beach cut
Time Limit: 5000MSMemory Limit: 65536K
Total Submissions: 891Accepted: 188

Description

The seashore is represented by a polyline without self-intersections, described by a sequence of vertices (x1, y1), ... (xN, yN). It also has a property that xi < xi + 1. The sea is above the line, and the beach -- below.

Your program must connect two vertices with a straight line not longer than L chosen so as to maximize the beach area enclosed between that line and the shore. The line must not intersect with the sea and may only touch, not intersect, the shore polyline.
Constraints
3 ≤ N ≤ 5000, 0 ≤ xi, yi, L ≤ 1000000

Input

Input contains integer numbers N L, followed by N pairs of integers x1 y1 … xN yN.

Output

Output must contain a single floating point value -- the maximum area that can be cut (it may be zero). The area must be output exactly, i.e. without any rounding at all.

Sample Input

5 4
0 0  1 3  2 0  3 3  4 0

Sample Output

6

Source

Northeastern Europe 2003, Far-Eastern Subregion

[Submit]   [Go Back]   [Status]   [Discuss]

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator