program paprastas_kelias;
  { 18 u‘davinys }
  type koord = 1..100;
  function kelias (xa, ya, xb, yb : koord) : integer;
    var dx, dy : integer;
  begin
    dx := abs (xa - xb);
    dy := abs (ya - yb);
    if dx > dy
       then kelias := dx + 1
       else kelias := dy + 1
  end;
  var xa, xb, ya, yb : koord;
begin
  write ('­veskite langeli— A ir B koordinates: ');
  readln (xa, ya, xb, yb);
  writeln (kelias (xa, ya, xb, yb))
end.
