Pagini recente » Cod sursa (job #1017100) | Monitorul de evaluare | Istoria paginii runda/23dezile_6/clasament | Cod sursa (job #1048774) | Cod sursa (job #1744954)
type punct=record
x,y:longint;
end;
tablou=array [1..100005]of punct;
var t:tablou;
x0,y0,i,m,n:longint;
aria:real;
f,g:text;
b:boolean;
s:string;
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);
str(aria:5:5,s);
while s[length(s)]='0' do
delete(s,length(s),1);
if s[length(s)]='.'then delete(s,length(s),1);
write(g,s);
close(f);
close(g);
end.