Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # печалба = (бр. пъзели * 2.60) + (бр. кукли * 3) + (бр. мечета * 4.10) + (бр. миньони * 8.20) + (бр. камиони * 2)
- # бр. играчки = бр. пъзели + бр. кукли + бр. мечета + бр.миньони + бр. камиони
- # проверка дали има отстъпка: бр. играчки >= 50 -> печалба - 25%
- # наем = 10% от печалбата -> печалба - наем
- # проверка дали печалбата покрива цената на екскурзията
- trip_price = float(input())
- puzzles_count = int(input())
- dolls_count = int(input())
- bears_count = int(input())
- minions_count = int(input())
- trucks_count = int(input())
- profit = (puzzles_count * 2.60) + (dolls_count * 3) + (bears_count * 4.10) \
- + (minions_count * 8.20) + (trucks_count * 2)
- toys_count = puzzles_count + dolls_count + bears_count + minions_count + trucks_count
- #отстъпка
- if toys_count >= 50:
- profit = profit - 0.25 * profit
- #profit = profit * 0.75 -> profit *= 0.75
- # наем
- profit = profit - profit * 0.10
- # profit = profit * 0.9 -> profit *= 0.9
- if profit >= trip_price:
- left_money = profit - trip_price
- print(f'Yes! {left_money:.2f} lv left.')
- else:
- need_money = trip_price - profit
- print(f'Not enough money! {need_money:.2f} lv needed.')
Advertisement
Add Comment
Please, Sign In to add comment