22692_Max'sIslands

2022-5-16 18:22| 发布者: Hocassian| 查看: 27| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506861294900-Problem List-采集的数据-后羿采集器.html

Pro.ID

22692

Title

Max's Islands

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22692

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    There are n islands in the map, shown in Figure 1. God gives Max a magic pen and tells him that he can use this pen to draw a close area in the map. And all of the islands inside the close area (including those locate on the edge of the area) will belong to Max. Of course, Max, today's judge, is not a greedy boy. However, as his name, Max wants to maximize all the things he wants. God is not stupid. He challenges Max that the line drew by the pen can not exceed m meters and Max can only use the pen for one time (that means once the pen leaves the map, it is over, namely, Max must draw the area in one line) Note, for the situation that islands are collinear, the minimum length needed to cover these islands is 2* the longest length of the segment formed by islands. Refer to sample input for details.

    Figure 1  Max's Islands

    输入

    Input contains multiple test data sets.

    For each data set, first comes one integer n ( 1 ≤ n < 19 ), the number of the islands. Then n lines follow, each has two float numbers x, y ( |x| < 108 , |y| < 108 ), the coordinates of that island. Finally comes one float m, ( |m| < 109 ) the limit described as above. The points may be overlaped, but they are regarded as different points.

    Input is terminated by EOF.

    输出

    Description

    There are n islands in the map, shown in Figure 1. God gives Max a magic pen and tells him that he can use this pen to draw a close area in the map. And all of the islands inside the close area (including those locate on the edge of the area) will belong to Max. Of course, Max, today's judge, is not a greedy boy. However, as his name, Max wants to maximize all the things he wants. God is not stupid. He challenges Max that the line drew by the pen can not exceed m meters and Max can only use the pen for one time (that means once the pen leaves the map, it is over, namely, Max must draw the area in one line) Note, for the situation that islands are collinear, the minimum length needed to cover these islands is 2* the longest length of the segment formed by islands. Refer to sample input for details.

    Figure 1  Max's Islands
    Input

    Input contains multiple test data sets.

    For each data set, first comes one integer n ( 1 ≤ n < 19 ), the number of the islands. Then n lines follow, each has two float numbers x, y ( |x| < 108 , |y| < 108 ), the coordinates of that island. Finally comes one float m, ( |m| < 109 ) the limit described as above. The points may be overlaped, but they are regarded as different points.

    Input is terminated by EOF.

    Output

    For each test data set, one output data set should be generated as follow:

    Output one integer per line presenting the maximum number of islands Max can get.

    Sample Input

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

    Sample Output

    1
    2
    3
    2

    Source

    样例输入

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

    样例输出

    1
    2
    3
    2

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部