Current work
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
freopen("paint.in", "r", stdin);
|
||||
freopen("paint.out", "w", stdout);
|
||||
|
||||
int a, b, c, d;
|
||||
cin >> a >> b >> c >> d;
|
||||
|
||||
if (d < a || b < c) {
|
||||
cout << (b - a) + (d - c);
|
||||
} else {
|
||||
cout << abs(max(b, d) - min(a, c));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user