본문 바로가기
공부/코딩테스트

백준: 21591번 Laptop Sticker (Python3)

by 혼밥맨 2022. 8. 9.
반응형

백준: 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>=2else 0)
cs
반응형

댓글