Pagini recente » Cod sursa (job #2195727) | Cod sursa (job #38996) | Cod sursa (job #2612978) | Cod sursa (job #2375799) | Cod sursa (job #1744950)
type punct=record
x,y:longint;
end;
tablou=array [1..100005]of punct;
var t:tablou;
x0,y0,i,m,n:longint;
aria:double;
f,g:text;
b:boolean;
begin
assign(f,'aria.in');
assign(g,'aria.out');
reset(f);
rewrite(g);
read(f,n);
for i:=1 to n do
read(f,t[i].x,t[i].y);
x0:=0;
y0:=0;
b:=true;
while b do
begin
b:=false;
i:=1;
while (t[i].x<>x0)and(t[i].y<>y0)and (i<=n) do
i:=i+1;
if i<=n then begin
b:=true;
y0:=y0+1;
end;
end;
i:=1;
while i<=n-1 do
begin
aria:=aria+0.5*(t[i].x*t[i+1].y-t[i+1].x*t[i].y);
i:=i+1;
end;
aria:=aria+0.5*(t[n].x*t[1].y-t[1].x*t[n].y);
write(g,aria:5:5);
close(f);
close(g);
end.