Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n, k = map(int, input().split())
- a,b,c = map(int, input().split())
- s = n
- s = min(s, abs(k-a))
- s = min(s, abs(k-b))
- s = min(s, abs(k-c))
- s = min(s, abs(k+n-a))
- s = min(s, abs(k+n-b))
- s = min(s, abs(k+n-c))
- print(s)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement