Pagini recente » Cod sursa (job #2369660) | Cod sursa (job #1018118) | Cod sursa (job #2567711) | Cod sursa (job #2348298) | Cod sursa (job #1147267)
program puncte;
var n,ans,i,j,g,h:longint;
x,y:array [0..1000] of longint;
begin
assign(input,'trapez.in');
reset(input);
assign(output,'trapez.out');
rewrite(output);
readln(n);
for i:=1 to n do readln(x[i],y[i]);
for i:=1 to n do
for j:=i+1 to n do
for h:=i+1 to n do
if (h<>i)and(h<>j) then
for g:=h+1 to n do
if (g<>i)and(g<>j) then
begin
if (x[i]<>x[j])and(x[g]<>x[h])and(x[j]<>x[h]) then
begin
if ((y[i]-y[j])/(x[i]-x[j])=(y[h]-y[g])/(x[h]-x[g]))and
((y[i]-y[j])/(x[i]-x[j])<>(y[i]-y[h])/(x[j]-x[h])) then
inc(ans);
end else
begin
if (x[i]=x[j])and(x[g]=x[h])and(x[j]<>x[h]) then inc(ans);
if (x[i]<>x[j])and(x[g]<>x[h])and(x[j]=x[h]) then
if ((y[i]-y[j])/(x[i]-x[j])=(y[h]-y[g])/(x[h]-x[g])) then
inc(ans);
end;
end;
writeln(ans);
close(output);
end.