Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fi = open('paint.in', 'r')
- fo = open('paint.out', 'w')
- a, b = map(int, fi.readline().split())
- c, d = map(int, fi.readline().split())
- len = max(b, d) - min(c, a)
- if a < c and b < c:
- len -= c - b
- elif c < a and d < a:
- len -= d - a
- print(len, file = fo)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement