Advertisement
T-D-K

Untitled

May 3rd, 2018
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. n, k = map(int, input().split())
  2. a,b,c = map(int, input().split())
  3. s = n
  4. s = min(s, abs(k-a))
  5. s = min(s, abs(k-b))
  6. s = min(s, abs(k-c))
  7. s = min(s, abs(k+n-a))
  8. s = min(s, abs(k+n-b))
  9. s = min(s, abs(k+n-c))
  10. print(s)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement