记录编号 22384 评测结果 AAAAAAAAAA
题目名称 扩散 最终得分 100
用户昵称 Gravatarmagic 是否通过 通过
代码语言 Pascal 运行时间 0.017 s
提交时间 2010-11-18 20:14:27 内存使用 0.12 MiB
显示代码纯文本
program gls;
var

ss:array[1..50,1..50]of longint;
st:array[1..50,1..2]of longint;
n,k,a,b,ans,i,j:longint;

f,g:text;
    function max(const a,b:longint):longint;
    begin
      if a>b then exit(a) else exit(b);
    end;
begin
assign(f,'ppg.in');
reset(f);
assign(g,'ppg.out');
rewrite(g);

readln(f,n);
for k:=1 to n do
begin readln(f,st[k,1],st[k,2]);

end;


for i:=1 to n do
 for j:=1 to n do
 begin ss[i,j]:=(abs(st[i,1]-st[j,1])+abs(st[i,2]-st[j,2]))div 2;
     if  (abs(st[i,1]-st[j,1])+abs(st[i,2]-st[j,2]))mod 2<>0 then
      inc(ss[i,j]);

 end;


  for k:=1 to n do
   for i:=1 to n do
     for j:=1 to n do
      if max(ss[i,k],ss[k,j])<ss[i,j] then ss[i,j]:=max(ss[i,k],ss[k,j]);
   ans:=0;
{  for i:=1 to n do
  begin   for j:=1 to n do
      write(g,ss[i,j],' ');
      writeln(g);
     end; }
  for i:=1 to n do
    for j:=1 to n do
   if ss[i,j]>ans then ans:=ss[i,j];








writeln(g,ans);

close(g);close(f);
end.