Guest User

Untitled

a guest
Sep 28th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. l = [[int(i.split(' ')[0]), int(i.split(' ')[1])] for i in open('paint.in', 'r')]
  2.  
  3. l = sorted(l, key=lambda x: x[0])
  4.  
  5. a = l[0][0]
  6. b = l[0][1]
  7. c = l[1][0]
  8. d = l[1][1]
  9.  
  10. if c <= b:
  11.     out = max(d, b) - a
  12.  
  13. else:
  14.     out = (b - a) + (d - c)
  15.  
  16. open('paint.out', 'w').write(str(out))
Add Comment
Please, Sign In to add comment