记录编号 22252 评测结果 AAAAAAAAAA
题目名称 扩散 最终得分 100
用户昵称 Gravatar苏轼 是否通过 通过
代码语言 Pascal 运行时间 0.013 s
提交时间 2010-11-18 11:57:55 内存使用 0.12 MiB
显示代码纯文本
program ppg(input,output);

type
  re=record
    x,y:longint;
  end;

var
  n,i,j,k,tmp:longint;
  c:array[1..50]of re;
  way:array[1..50,1..50]of longint;

function dis(const a,b:re):longint;
  var
    ans:longint;
  begin
    ans:=abs(a.x-b.x)+abs(a.y-b.y);
    if odd(ans) then
      exit(ans div 2+1)
    else
      exit(ans div 2);
  end;

begin
  assign(input,'ppg.in');
  reset(input);
  assign(output,'ppg.out');
  rewrite(output);

  readln(n);
  for i:=1 to n do
  begin
    readln(c[i].x,c[i].y);
    for j:=1 to i-1 do
    begin
      way[i,j]:=dis(c[i],c[j]);
      way[j,i]:=way[i,j];
    end;
  end;

  for k:=1 to n do
    for i:=1 to n do
      for j:=1 to n do
      begin
        if way[i,k]>way[k,j] then
          tmp:=way[i,k]
        else
          tmp:=way[k,j];

        if tmp<way[i,j] then
        begin
          way[i,j]:=tmp;
          way[j,i]:=tmp;
        end;
      end;

  tmp:=0;
  for i:=1 to n do
    for j:=1 to n do
      if way[i,j]>tmp then
        tmp:=way[i,j];

  writeln(tmp);

  close(input);
  close(output);
end.