Advertisement
Guest User

Untitled

a guest
Jan 28th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. green_light, red_light = list(map(int, input().split()))
  2. s, v, a = list(map(int, input().split()))
  3. period = green_light + red_light
  4. t = s / v
  5. if t % period - green_light < 0:
  6.     print('Pass')
  7. else:
  8.     stop = v ** 2 / (2 * a)
  9.     stop_time = (s - stop) / v + v / a
  10.     stop_time = stop + (period - stop % period)
  11.     print(f"{stop:.3f} {stop_time:.3f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement