0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 03:31:59 +00:00

P5098 [USACO04OPEN]Cave Cows 3

R52410308
This commit is contained in:
Baoshuo Ren 2021-07-05 10:24:40 +08:00 committed by Baoshuo Ren
parent 1994cdc40f
commit ae54bdd2ee
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

View File

@ -0,0 +1,19 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, x, y, a, b, c, d;
a = c = -0x3f3f3f3f;
b = d = 0x3f3f3f3f;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> x >> y;
a = max(a, x + y);
b = min(b, x + y);
c = max(c, x - y);
d = min(d, x - y);
}
cout << max(a - b, c - d) << endl;
return 0;
}