Apauldin

3

Oct 27th, 2021
772
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. s = int(input())
  2. e = int(input())
  3. n = int(input())
  4. min_l = 10**9
  5. min_r = min_l
  6. for i in range(n):
  7.     x = int(input())
  8.     min_l = min(min_l, abs(x - s))
  9.     min_r = min(min_r, abs(x - e))
  10. print(min(abs(s - e), min_l + min_r + 1))
RAW Paste Data