From 7b286f7927b6bc55cd74b978b15db5e22d5c82f2 Mon Sep 17 00:00:00 2001 From: Jihoon Lee Date: Mon, 19 Feb 2024 04:26:10 +0900 Subject: [PATCH] Add 15751.cpp --- 15xxx/15751.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 15xxx/15751.cpp diff --git a/15xxx/15751.cpp b/15xxx/15751.cpp new file mode 100644 index 00000000..e6404f53 --- /dev/null +++ b/15xxx/15751.cpp @@ -0,0 +1,18 @@ +#include +#include +#include +using namespace std; + +void solve(void) { + int a, b, x, y; cin >> a >> b >> x >> y; + + cout << min(abs(b-a), abs(min(a, b)-min(x, y))+abs(max(a, b)-max(x, y))); +} + +int main(void) { + ios::sync_with_stdio(false); + cin.tie(nullptr); + + solve(); + return 0; +} \ No newline at end of file