Pro.ID22692 TitleMax's Islands Title链接http://10.20.2.8/oj/exercise/problem?problem_id=22692 AC0 Submit0 Ratio- 时间&空间限制描述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 Sample Output 1 Source 样例输入2 样例输出1 作者 |