Advertisement
Guest User

E

a guest
Mar 18th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. T, W, Y, V = map(int, input().split(' '))
  2.  
  3. N = int(input())
  4. cols = list(map(int, input().split(' ')))
  5.  
  6. K = int(input())
  7. cars = list(map(int, input().split(' ')))
  8.  
  9. res = T*K
  10.  
  11. if V + Y == 0:
  12.     for car in cars:
  13.         for col in cols:
  14.             pass
  15.  
  16.  
  17. for car in cars:
  18.     for col in cols:
  19.         w = col
  20.         ts = (w-car+w*Y)/(V+Y)
  21.  
  22.         w = col+W
  23.         tf = (w - car + w * Y) / (V + Y)
  24.  
  25.         if ts <= 0:
  26.             ts = 0
  27.         if tf <= 0:
  28.             tf = 0
  29.         if ts >= T:
  30.             ts = T
  31.         if tf >= T:
  32.             tf = T
  33.  
  34.         res -= abs(tf-ts)
  35.         # print('Start: {} \nFinish: {}\n---'.format(ts,tf))
  36.  
  37.     # print('*'*20)
  38.  
  39. print(res)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement