记录编号 26454 评测结果 AAAEEEWEEE
题目名称 遥远的距离 最终得分 30
用户昵称 GravatarYoghurt 是否通过 未通过
代码语言 Pascal 运行时间 0.592 s
提交时间 2011-07-24 15:41:11 内存使用 1.64 MiB
显示代码纯文本
program faraway;
const
        filename='faraway';
        maxn=100000;
var
        t,n,m:longint;
        ans:extended;
        xa,xb,ya,yb:array[0..maxn] of longint;

procedure solve;
var
        i,j,k:longint;
        dis:extended;
begin
        readln(t);
        for k:=1 to t do
        begin
                readln(n,m);
                dis:=0;
                for i:=1 to n do readln(xa[i],ya[i]);
                for i:=1 to m do readln(xb[i],yb[i]);
                for i:=1 to n do
                for j:=1 to m do
                begin
                        dis:=sqrt((xa[i]-xb[j])*(xa[i]-xb[j])+(ya[i]-yb[j])*(ya[i]-yb[j]));
                        if dis>ans then ans:=dis;
                end;
        end;
end;

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

        solve;
        writeln(ans:0:3);

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