728x90
반응형
fs, fl = map(int, input().split())
cs, cl= map(int, input().split())
#if not overlapping
if cs>=fl or cl<=fs:
print( fl-fs + cl-cs)
else:
print( max(fl,cl) - min(fs,cs) )
728x90
반응형
'Algorithm Problems' 카테고리의 다른 글
[백준] 1157 .py - 단어 공부 (0) | 2021.01.15 |
---|---|
[백준] 2231 .py - 분해합 (0) | 2021.01.15 |
[백준] 2884 .py - 알람시계 (0) | 2021.01.15 |
[백준] 9020 .py - 골드바흐의 추측 (0) | 2021.01.15 |
[백준] 11971.py - 속도위반 (USACO Bronze) (0) | 2021.01.15 |