Pagini recente » Cod sursa (job #1791107) | Cod sursa (job #3250630) | Cod sursa (job #1187601) | Cod sursa (job #1409402) | Cod sursa (job #1147356)
var x, y: array[1..1000] of longint;
u1, u2: array[1..1000] of boolean;
n, m, i, t, j, k, f: integer;
begin
assign(input,'trapez.in');
reset(input);
assign(output,'trapez.out');
rewrite(output);
readln(n);
for i:=1 to n do begin read(x[i]); read(y[i]); u1[i]:=false; u2[i]:=false; end;
t:=0;
for i:=1 to n-1 do
for j:=i+1 to n do
for k:=1 to n-1 do
if (k<>i) and (k<>j) then
for f:=k+1 to n do
if (f<>i) and (f<>j) then
begin
if (((x[k]-x[f]=0) and (x[i]-x[j]=0))
or ((y[k]-y[f]=0) and (y[i]-y[j]=0)) or
(((x[k]-x[f]<>0) and (x[i]-x[j]<>0) and (y[k]-y[f]<>0) and (y[i]-y[j]<>0))
and ((x[k]-x[f])/(y[k]-y[f])=(x[i]-x[j])/(y[i]-y[j]))))
and ( not(u2[k]) or not(u2[f]) or not(u1[k]) or not(u1[k]))
then begin
inc(t);
u1[i]:=true; u2[i]:=true;
u2[j]:=true; u2[j]:=true;
u2[k]:=true; u2[k]:=true;
u2[f]:=true; u2[f]:=true;
end;
end;
writeln(t);
close(input);
close(output);
end.