From 096f23c71ef99283e66e19fae2e6078c3f9b82f6 Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Fri, 1 Oct 2021 18:13:39 +0800 Subject: [PATCH] =?UTF-8?q?HDR003A.=20=E3=80=8CMCOI-06=E3=80=8DFlight?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://hydro.ac/record/6156deb33713cfcd8ab56209 --- Hydro/HDR003A/HDR003A.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Hydro/HDR003A/HDR003A.cpp diff --git a/Hydro/HDR003A/HDR003A.cpp b/Hydro/HDR003A/HDR003A.cpp new file mode 100644 index 00000000..3442d17d --- /dev/null +++ b/Hydro/HDR003A/HDR003A.cpp @@ -0,0 +1,16 @@ +#include + +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; +}