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