CF852H.Bob and stages
NOI/NOI+/CTSC
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
The citizens of BubbleLand are celebrating their 10th anniversary so they decided to organize a big music festival. Bob got a task to invite N famous singers who would sing on the fest. He was too busy placing stages for their performances that he totally forgot to write the invitation e-mails on time, and unfortunately he only found K available singers. Now there are more stages than singers, leaving some of the stages empty. Bob would not like if citizens of BubbleLand noticed empty stages and found out that he was irresponsible.
Because of that he decided to choose exactly K stages that form a convex set, make large posters as edges of that convex set and hold festival inside. While those large posters will make it impossible for citizens to see empty stages outside Bob still needs to make sure they don't see any of the empty stages inside that area.
Since lots of people are coming, he would like that the festival area is as large as possible. Help him calculate the maximum area that he could obtain respecting the conditions. If there is no such area, the festival cannot be organized and the answer is 0.00.
BubbleLand 的市民正在庆祝建国十周年,因此他们决定举办一场盛大的音乐节。Bob 承担了邀请 N 位著名歌手前来演出的任务。然而,他忙于为歌手们搭建舞台,完全忘记了及时发送邀请邮件,结果不幸地只成功邀请到了 K 位歌手。现在舞台的数量多于歌手数量,导致部分舞台空置。Bob 不希望 BubbleLand 的市民注意到这些空置的舞台,从而发现他工作失职。
为此,他决定恰好选择 K 座舞台,使其构成一个凸集(即这 K 个点是某个凸多边形的顶点),并用大型海报将该凸集的各条边围起来,在围成的区域内举办音乐节。这些大型海报将有效遮挡市民视线,使其无法看到围栏外部的空置舞台;但 Bob 仍需确保围成的区域内不出现任何空置舞台(即:所有未被选中的其余 N−K 座舞台,都必须严格位于该凸多边形外部或边界上——注意:题目隐含要求“不能看到任何空置舞台”,故内部不允许存在空置舞台;标准理解为:其余 N−K 个点不得落在该凸多边形的内部)。
由于将有大量观众到场,Bob 希望音乐节区域的面积尽可能大。请你帮助他计算在满足上述条件的前提下所能获得的最大面积。若不存在满足条件的区域,则音乐节无法举办,答案为 0.00。
输入格式
The first line of input contains two integers N (3 ≤ N ≤ 200) and K (3 ≤ K ≤ min(N, 50)), separated with one empty space, representing number of stages and number of singers, respectively.
Each of the next N lines contains two integers X__i and Y__i (0 ≤ X__i, Y__i ≤ 106) representing the coordinates of the stages. There are no three or more collinear stages.
输入的第一行包含两个整数 N(3≤N≤200)和 K(3≤K≤min(N,50)),用一个空格分隔,分别表示舞台的数量和歌手的数量。
接下来的 N 行中,每行包含两个整数 Xi 和 Yi(0≤Xi,Yi≤106),表示第 i 个舞台的坐标。不存在三个或更多共线的舞台。
输出格式
Output contains only one line with one number, rounded to exactly two decimal places: the maximal festival area. Rounding is performed so that 0.5 and more rounds up and everything else rounds down.
输出仅包含一行,其中为一个数字,精确到小数点后两位:即最大的节日区域面积。四舍五入规则为:小数部分大于等于 0.5 时向上取整,其余情况向下取整。
输入输出样例
输入#1
5 4 0 0 3 0 2 1 4 4 1 5
输出#1
10.00
说明/提示
Example explanation: From all possible convex polygon with 4 vertices and no other vertex inside, the largest is one with points (0, 0), (2, 1), (4, 4) and (1, 5).
示例解释:在所有可能的、具有 4 个顶点且内部不含其他顶点的凸多边形中,面积最大的一个是顶点为 (0,0)、(2,1)、(4,4) 和 (1,5) 的多边形。
输入解题思路,AI测评打分。不知道怎么写?