Pagini recente » Diferente pentru utilizator/siminescu intre reviziile 10 si 11 | Diferente pentru monthly-2014 intre reviziile 16 si 15 | Diferente pentru problema/bombar intre reviziile 31 si 30 | Diferente pentru problema/sirinf intre reviziile 30 si 31 | Cod sursa (job #1147192)
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.