传送门
http://www.lydsy.com/JudgeOnline/problem.php?id=1108
题目大意
求最小曼哈顿距离
题解
题目里面提到只能向下或向右走,那么就是要连接的点一定在连他的点的右下方~
var
xx,yy:int64;
n,i,a,b:longint;
begin
readln(n); xx:=0; yy:=0;
for i:=1 to n do
begin
readln(a,b);
dec(xx,a); inc(yy,b);
end;
for i:=1 to n do
begin
readln(a,b);
inc(xx,a); dec(yy,b);
end;
writeln(xx+yy);
end.