Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- l = [[int(i.split(' ')[0]), int(i.split(' ')[1])] for i in open('paint.in', 'r')]
- l = sorted(l, key=lambda x: x[0])
- a = l[0][0]
- b = l[0][1]
- c = l[1][0]
- d = l[1][1]
- if c <= b:
- out = max(d, b) - a
- else:
- out = (b - a) + (d - c)
- open('paint.out', 'w').write(str(out))
Add Comment
Please, Sign In to add comment