Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def min(x,y):
- if x>=y:
- return y
- elif y>=x:
- return x
- c, x, y, z, m, s,f, e, t= input().split()
- c = int(c)
- x = int(x)
- y = int(y)
- z = int(z)
- m = int(m)
- s = int(s)
- f = int(f)
- e = int(e)
- t = int(t)
- time=0
- time1=0
- time2=0
- if c<=x:
- if c%s==0:
- time = m*(c//s)
- else:
- time = (m*(c//s))+m
- print(time)
- elif c>x:
- newstoragecost=0
- if (c-x)%z ==0:
- newstoragecost = y*((c-x)//z)
- money = c + newstoragecost
- if money % s == 0:
- time1 = (money // s)* m
- else:
- time1 = ((money // s)* m) + m
- else:
- newstoragecost = (y*((c-x)//z)) + y
- money = c + newstoragecost
- if money % s == 0:
- time1 = (money // s)* m
- else:
- time1 = ((money // s)* m) + m
- infantrycost= (e+1)*f
- if infantrycost % s == 0:
- time2 = (infantrycost // s) * m +t
- else:
- time2 = ((infantrycost// s) * m) + m + t
- print (min(time1, time2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement