백준: 21591번 Laptop Sticker (Python3)
Laptop Sticker 성공다국어
1 초 | 1024 MB | 932 | 666 | 639 | 73.280% |
문제
Your school has provided you with a laptop computer! However, they insist on putting a laptop sticker with their logo on your new computer. That sticker might be very large, and it can’t be rotated! Will it fit, with one centimeter to spare on all sides?
입력
The single line of input contains four integers wc , hc , ws and hs (1≤wc,hc,ws,hs≤1,000 ), where wc is the width of your new laptop computer, hc is the height of your new laptop computer, ws is the width of the laptop sticker, and hs is the height of the laptop sticker. All measurements are in centimeters.
출력
Output a single integer, which is 1 if the laptop sticker will fit on your new laptop computer, without rotating, but with one centimeter space on all sides, and 0 if the laptop sticker won’t fit.
예제 입력 1
30 30 27 27
예제 출력 1
1
예제 입력 2
35 30 25 29
예제 출력 2
0
예제 입력 3
30 35 30 35
예제 출력 3
0
답안
1
2
3
|
wc, hc, ws, hs = map(int, input().split())
print(1 if (wc-ws>=2 and hc-hs>=2) else 0)
|
cs |
'공부 > 코딩테스트' 카테고리의 다른 글
백준: 21335번 Another Eruption (Python3) (0) | 2022.08.09 |
---|---|
백준: 21354번 Äpplen och päron (Python3) (0) | 2022.08.09 |
백준: 21598번 SciComLove (Python3) (0) | 2022.08.09 |
백준: 21612번 Boiling Water (Python3) (0) | 2022.08.09 |
백준: 21631번 Checkers (Python3) (0) | 2022.08.09 |
댓글