알고리즘 공부/BOJ백준 풀이
[백준 1085번-파이썬/Python] 직사각형에서 탈출
Coder38611
2020. 12. 17. 22:43
http://acmicpc.net/problem/1085

{코드}
x, y, w, h = map(int, input().split())
print(min(x, y, w-x, h-y))
{설명}
주어진 직사각형은 x축, y축, x=w, y=h로 이루어졌습니다.
즉, 각 경계선까지의 거리는 주어진 x, y, w-x, h-y이므로 이중 가장 작은 값을 출력하면 된다.