0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-28 12:11:58 +00:00

P7885 「MCOI-06」Flight

R58885768
This commit is contained in:
Baoshuo Ren 2021-10-02 07:15:16 +08:00 committed by Baoshuo Ren
parent 57c70f1b93
commit 3f74ca843e
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

View File

@ -0,0 +1,16 @@
#include <bits/stdc++.h>
using namespace std;
long long t, a, b, c, d, x, y, k;
int main() {
cin >> t;
while (t--) {
cin >> a >> b >> c >> d;
x = abs(a - c);
y = abs(b - d);
cout << max(x, y) * 2 - !(x % 2 == 0 && y % 2 == 0 || x % 2 && y % 2) << endl;
}
return 0;
}