You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
680 B
C++

#define _CRT_SECURE_NO_WARNINGS
#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING
#include <bits/stdc++.h>
using namespace std;
struct Point
{
double x, y;
} ps[1050];
double area(const Point &a, const Point &b, const Point &c)
{
return abs(b.x * c.y + a.x * b.y + c.x * a.y - c.x * b.y - b.x * a.y - a.x * c.y) / 2;
}
int main()
{
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++)
scanf("%lf%lf", &ps[i].x, &ps[i].y);
double ans = 0;
for (int i = 0; i < n; i++)
for (int j = 0; j < i; j++)
for (int k = 0; k < j; k++)
ans = max(ans, area(ps[i], ps[j], ps[k]));
printf("%.2lf", ans);
return 0;
}