program pil_8_53(input,output);
const
  n = 3;
type
  massiv = array [1..n] of real;
var
  x, y : massiv;
  l, minl : real;
  i, j, mini, minj : integer;
begin
  Write('Input pairs of points coordinats : ');
  read(x[1], y[1], x[2], y[2]);
  mini := 2; minj := 1;
  minl := sqr(x[1]-x[2])+sqr(y[1]-y[2]);
  for i:=3 to n do begin
    read(x[i],y[i]);
    for j:=1 to i-1 do begin
      l := sqr(x[i]-x[j])+sqr(y[i]-y[j]);
      if l<minl then begin
        minl := l;
        mini := i;
        minj := j;
      end;
    end;
  end;
  WriteLn('Minimum way is ', sqrt(minl), ' between points # ', minj, ' and ', mini, '.');
end.
