Pagini recente » Cod sursa (job #1268236) | Cod sursa (job #555617) | Cod sursa (job #3255272) | Cod sursa (job #1478215) | Cod sursa (job #1147180)
Program puncte;
const INF=999999999;
type coordonata = record
x : longint;
y : longint;
end;
function panta (x,y,x1,y1 : longint) : real;
begin
if (x1-x<>0) then panta:=(y1-y)/(x1-x)
else panta:=INF;
end;
var M : array [1..1010,1..1010] of real;
Viz : array [1..1010,1..1010] of 0..1;
K :array [1..1010] of coordonata;
i,n,j,l,p,t :longint;
begin
assign(input,'trapez.in'); reset(input);
assign(output,'trapez.out'); rewrite(output);
readln(n);
for i:=1 to n do readln(K[i].x,K[i].y);
for i:=1 to n do
for j:=1 to n do
M[i,j]:=panta(k[i].x,k[i].y,k[j].x,k[j].y);
for i:=1 to n do
for j:=1 to n do viz[i,j]:=0;
for i:=1 to n do
for j:=1 to n do begin
if viz[i,j]=0 then
if (M[i,j]<>INF) then begin
viz[i,j]:=1;
for l:=1 to n do
for p:=1 to n do
if (M[l,p]=M[i,j]) and
(viz[l,p]=0) and
(i<>l) and
(i<>p) and
(j<>l) and
(j<>p) then begin
t:=t+1;
viz[l,p]:=1;
end; end;
end;
writeln(t div 2);
close(output);
close(input);
end.