Pagini recente » Cod sursa (job #2795461) | Cod sursa (job #1446634) | Cod sursa (job #2956556) | Cod sursa (job #1057506) | Cod sursa (job #1095732)
program infas;
var n,m,i,j,k,o:longint;
x,y,p:array[1..120000] of real;
st:array[1..120000] of longint;
procedure sort(l,r:longint);
var i,j:longint;
aux,m:real;
begin
i:=l;
j:=r;
m:=p[(i+j)div 2] ;
repeat
while p[i]<m do inc(i);
while p[j]>m do dec(j);
if i<=j then begin
aux:=x[i];
x[i]:=x[j];
x[j]:=aux;
aux:=y[i];
y[i]:=y[j];
y[j]:=aux;
aux:=p[i];
p[i]:=p[j];
p[j]:=aux;
end;
until i>j;
if i<r then sort(i,r);
if l<j then sort(l,j);
end;
function Semn(i,j,k:longint);
begin
semn:=x[i]*y[j]+x[j]*y[k]+x[k]*y[i]-y[i]*x[j]-y[j]*x[k]-y[k]*x[i];
end;
begin
assign(input,'infas.in'); reset(input);
assign(output,'infas.out'); rewrite(output);
readln(n); o:=1;
for i:=1 to n do begin
readln(x[i]);
readln(y[i]);
if (x[i]<x[o]) or ((x[i]=x[o] and (y[i]<y[o]))) then
o:=i;
end;
aux:=x[1];
x[1]:=x[o];
x[o]:=aux;
aux:=y[1];
y[1]:=y[o];
y[o]:=aux;
for i:=1 to n do p[i]:=