Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. import sys
  2. weekMins = 10080
  3. ans = []
  4. s = input().split(' ')
  5. lawn = int(s[0])
  6. m = int(s[1])
  7. minPrice = sys.float_info.max
  8. for i in range(m):
  9. s = input().split(',')
  10. name = s[0]
  11. price = int(s[1])
  12. cut = int(s[2])
  13. time = int(s[3])
  14. recharge = int(s[4])
  15. meters = 0
  16. timer = 0
  17. while timer < 10080:
  18. if timer + time >= 10080:
  19. meters += cut * (10080 - timer - 1)
  20. break
  21. meters += cut * time
  22. timer += time + recharge
  23. if meters >= lawn:
  24. if price < minPrice:
  25. minPrice = price
  26. ans = []
  27. ans.append(name)
  28. elif price == minPrice:
  29. ans.append(name)
  30. if len(ans) == 0:
  31. print("no such mover")
  32. else:
  33. for i in ans:
  34. print(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement