📄 ac1235.pas
字号:
program ural1235;
const
maxn=100;
var
x,y:array[1..maxn]of word;
n,i,j,k:byte;
w,h,a,b,ans:word;
function min(a,b:word):word;
begin
if a<b then min:=a else min:=b;
end;
function max(a,b:word):word;
begin
if a>b then max:=a else max:=b;
end;
procedure check(p,q:word);
var
size:word;
i:byte;
begin
size:=min(w-p,h-q);
for i:=1 to n do
if (x[i]>p) and (y[i]>q) then
size:=min(size,max(x[i]-p,y[i]-q));
if size>ans then begin
ans:=size;a:=p;b:=q;
end;
end;
begin
read(n,w,h);
for i:=1 to n do
read(x[i],y[i]);
check(0,0);
for i:=1 to n do begin
check(x[i],0);
check(0,y[i]);
end;
for i:=1 to n do
for j:=1 to n do
if (x[i]<x[j]) and (y[i]>y[j]) then
check(x[i],y[j]);
writeln(a,' ',b,' ',ans);
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -