Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. c, x, y, z, m, s, f, e, t = map(int, input().split())
  2.  
  3. hoho = 0
  4. hehe = 0
  5. hihi = 0
  6. if c <= x:
  7. if c % s == 0:
  8. hoho = m * (c // s)
  9. else:
  10. hoho = (m * (c // s)) + m
  11. print(hoho)
  12. elif c > x:
  13. haha = 0
  14. if (c - x) % z == 0:
  15. haha = y * ((c - x) // z)
  16. huhu = c + haha
  17. if huhu % s == 0:
  18. hehe = (huhu // s) * m
  19. else:
  20. hehe = ((huhu // s) * m) + m
  21. else:
  22. haha = (y * ((c - x) // z)) + y
  23. huhu = c + haha
  24. if huhu % s == 0:
  25. hehe = (huhu // s) * m
  26. else:
  27. hehe = ((huhu // s) * m) + m
  28. hyhy = (e + 1) * f
  29. if hyhy % s == 0:
  30. hihi = (hyhy // s) * m + t
  31. else:
  32. hihi = ((hyhy // s) * m) + m + t
  33. print(min(hehe, hihi))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement