CF340B.Maximal Area Quadrilateral
提高+/省选-
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Iahub has drawn a set of n points in the cartesian plane which he calls "special points". A quadrilateral is a simple polygon without self-intersections with four sides (also called edges) and four vertices (also called corners). Please note that a quadrilateral doesn't have to be convex. A special quadrilateral is one which has all four vertices in the set of special points. Given the set of special points, please calculate the maximal area of a special quadrilateral.
伊阿胡布在笛卡尔平面上画出了一组包含 n 个点的集合,他称这些点为“特殊点”。四边形是指一个无自交的简单多边形,具有四条边(也称为边)和四个顶点(也称为角)。请注意,四边形不一定是凸的。特殊四边形是指其四个顶点均属于特殊点集合的四边形。给定特殊点集合,请计算特殊四边形的最大面积。
输入格式
The first line contains integer n (4 ≤ n ≤ 300). Each of the next n lines contains two integers: x__i, y__i ( - 1000 ≤ x__i, y__i ≤ 1000) — the cartesian coordinates of _i_th special point. It is guaranteed that no three points are on the same line. It is guaranteed that no two points coincide.
第一行包含一个整数 n(4≤n≤300)。接下来的 n 行每行包含两个整数:xi、yi(−1000≤xi,yi≤1000),表示第 i 个特殊点的笛卡尔坐标。保证任意三点不共线,且任意两点不重合。
输出格式
Output a single real number — the maximal area of a special quadrilateral. The answer will be considered correct if its absolute or relative error does't exceed 10 - 9.
输出一个实数——特殊四边形的最大面积。若答案的绝对误差或相对误差不超过 10−9,则视为正确。
输入输出样例
输入#1
5 0 0 0 4 4 0 4 4 2 3
输出#1
16.000000
说明/提示
In the test example we can choose first 4 points to be the vertices of the quadrilateral. They form a square by side 4, so the area is 4·4 = 16.
在测试样例中,我们可以选择前 4 个点作为四边形的顶点。它们构成一个边长为 4 的正方形,因此面积为 4⋅4=16。
输入解题思路,AI测评打分。不知道怎么写?