main =>
RES = 0 ,
NUM = 10 ,
SIZE = 100 ,
ARR = new_array( 100 , 100 ) ,
foreach( I in 1 ..SIZE )
foreach( J in 1 ..SIZE )
ARR[ I, J] := 0
end
end,
KOCH = read_int( ) ,
foreach( I in 1 ..KOCH )
L = read_int( ) ,
R = read_int( ) ,
L:= L+51 , R:= R+51 ,
ARR[ L, R] := 1
end,
foreach( I in 1 ..NUM )
IT1 = 1 ,
IT2 = 2 ,
QX = new_array( 50 ) , QY = new_array( 50 ) ,
QX[ 1 ] = 51 , QY[ 1 ] = 51 ,
while ( IT1<= IT2)
X = QX[ IT1] , Y = QY[ IT1] ,
ARR[ X, Y] := I+10 ,
RES:= max ( RES, abs ( X-51 ) +abs ( Y-51 ) ) ,
if ( ARR[ X+I, Y] != 0 ) then
if ( ARR[ X+I, Y] != I+10 ) then
QX[ IT2] := X+I, QY[ IT2] := Y,
IT2:= IT2+1
end
end,
if ( ARR[ X-I, Y] != 0 ) then
if ( ARR[ X-I, Y] != I+10 ) then
QX[ IT2] := X-I, QY[ IT2] := Y,
IT2:= IT2+1
end
end,
if ( ARR[ X, Y+I] != 0 ) then
if ( ARR[ X, Y+I] != I+10 ) then
QX[ IT2] := X, QY[ IT2] := Y+I,
IT2:= IT2+1
end
end,
if ( ARR[ X, Y-I] != 0 ) then
if ( ARR[ X, Y-I] != I+10 ) then
QX[ IT2] := X, QY[ IT2] := Y-I,
IT2:= IT2+1
end
end,
IT1:= IT1+1
end
end,
print ( RES)
bWFpbiA9PiAKCVJFUyA9IDAsIAoJTlVNID0gMTAsIAoJU0laRSA9IDEwMCwgCglBUlIgPSBuZXdfYXJyYXkoMTAwLDEwMCksIAoJZm9yZWFjaChJIGluIDEuLlNJWkUpIAoJCWZvcmVhY2goSiBpbiAxLi5TSVpFKSAgCgkJCUFSUltJLEpdOj0wIAoJCWVuZCAKCWVuZCwgCgkKCUtPQ0ggPSByZWFkX2ludCgpLCAKCWZvcmVhY2goSSBpbiAxLi5LT0NIKSAKCQlMID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