#include int minfinder(int *arr) { int i, min = arr[0]; for (i = 0; i < 4; i++) { if (arr[i] < min) min = arr[i]; } return min; } int main() { int w, h; int arr[4]; scanf("%d %d %d %d", &arr[0], &arr[1], &w, &h); arr[2] = w - arr[0]; arr[3] = h - arr[1]; printf("%d\n", minfinder(arr)); return 0; }