Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def f(lst):
- a = lst[0]
- b = lst[1]
- c = lst[2]
- d = lst[3]
- e = lst[4]
- f = lst[5]
- g = lst[6]
- h = lst[7] + 1
- i = lst[8]
- gold_to_get_all_footmans = g * h
- time_footmans = (
- gold_to_get_all_footmans // f
- if gold_to_get_all_footmans % f == 0
- else gold_to_get_all_footmans // f + 1) * e + i
- _ = a - b if a - b > 0 else 0
- credits_to_build_all = (
- _ // d
- if _ % d == 0
- else _ // d + 1) * c
- times_to_get_credits_for_buildings = (
- c // f
- if c % f == 0
- else (c // f) + 1
- )
- a -= times_to_get_credits_for_buildings * f - credits_to_build_all
- time_credits = times_to_get_credits_for_buildings * e \
- + (a // f
- if a % f == 0
- else (a // f) + 1) * e
- return time_footmans, time_credits
- lst = list(map(int, input().split()))
- print(min(f(lst)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement