四边形的问题可以转化为三角形处理
穷举对角线,然后处理上下两个三角形,旋转卡壳
var x,y:array[..] of double;
q:array[..] of longint;
l,r,i,j,k,t,n:longint;
ans:double; function max(a,b:double):double;
begin
if a>b then exit(a) else exit(b);
end; function cross(i,j,k,r:longint):double;
begin
exit((x[i]-x[j])*(y[k]-y[r])-(x[k]-x[r])*(y[i]-y[j]));
end; procedure swap(var a,b:double);
var c:double;
begin
c:=a;
a:=b;
b:=c;
end; procedure sort(l,r: longint);
var i,j: longint;
p,q:double; begin
i:=l;
j:=r;
p:=x[(l+r) shr ];
q:=y[(l+r) shr ];
repeat
while (x[i]<p) or (x[i]=p) and (y[i]<q) do inc(i);
while (p<x[j]) or (p=x[j]) and (q<y[j]) do dec(j);
if not(i>j) then
begin
swap(x[i],x[j]);
swap(y[i],y[j]);
inc(i);
j:=j-;
end;
until i>j;
if l<j then sort(l,j);
if i<r then sort(i,r);
end; begin
readln(n);
for i:= to n do
readln(x[i],y[i]);
sort(,n);
q[]:=;
t:=;
for i:= to n do
begin
while (t>) and (cross(q[t],q[t-],i,q[t-])<=) do dec(t);
inc(t);
q[t]:=i;
end;
k:=t;
for i:=n- downto do
begin
while (t>k) and (cross(q[t],q[t-],i,q[t-])<=) do dec(t);
inc(t);
q[t]:=i;
end;
for i:= to t- do
q[i+t-]:=q[i];
for i:= to t- do
begin
l:=i+;
r:=i+;
while (r<i+t-) and (cross(q[i+],q[i],q[r],q[i])<cross(q[i+],q[i],q[r+],q[i])) do inc(r);
ans:=max(ans,cross(q[i+],q[i],q[i+],q[i])+cross(q[i+],q[i],q[r],q[i]));
for j:=i+ to i+t- do
begin
while (l<j-) and (cross(q[l+],q[i],q[j],q[i])>cross(q[l],q[i],q[j],q[i])) do inc(l);
while (r<i+t-) and (cross(q[j],q[i],q[r+],q[i])>cross(q[j],q[i],q[r],q[i])) do inc(r);
ans:=max(ans,cross(q[l],q[i],q[j],q[i])+cross(q[j],q[i],q[r],q[i]));
end;
end;
ans:=ans/;
writeln(ans::);
end.