Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import ceil, floor
- c,x,y,z,m,s,f,e,t = map(int, input().split())
- # стратегия набора кредитов
- def storageCredits():
- time = 0
- capacity = x
- amount = 0
- # построим необходимое кол-во хранилищ
- needed_strgs = ceil((c-x)/z)
- while needed_strgs > 0:
- time += m
- amount += s
- capacity += z
- if amount > capacity:
- amount = capacity
- can_buy_strgs = floor(amount/y)
- if can_buy_strgs > needed_strgs:
- can_buy_strgs = needed_strgs
- needed_strgs -= can_buy_strgs
- amount -= can_buy_strgs*y
- # а теперь поднимем бабла
- time += ceil((c-amount)/s)*m
- return time
- # стратегия победы над врагом
- def destroyEnemy():
- time = 0
- if s > x:
- # для начала стоит не терять деньги
- # и для этого нужно достроить хранилищ до уровня поступающей прибыли(s)
- # а дальше я не придумал
- else:
- pass
- return time
- print(destroyEnemy()) # измени эту строчку! min(destroyEnemy(), storageCredits())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement