Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int N, M, X, Y;
- cin >> N >> M >> X >> Y;
- if (N>M){
- swap (N, M);
- }
- int E= N-X, W= M-Y;
- int min1, min2;
- if (X<Y){
- min1 = X;
- }
- else {
- min1 = Y;
- }
- if (E<W){
- min2 = E;
- }
- else {
- min2 = W;
- }
- if (min1 < min2){
- cout << min1;
- }
- else {
- cout << min2;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement