编程介的小学生 2017-01-02 13:16 采纳率: 20.5%
浏览 811
已采纳

Beach cut

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

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-01-07 15:48
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 使用Photon PUN2解决游戏得分同步的问题
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了