Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 1. pechalba = pechalba ot puzelite + pechalba ot kukli + pechalba ot mechetata + pechalba ot minionite
- # + pechalba ot kamionchetata
- # 2. otstypka -> obsht broi na igrachkite >= 50 ->pechalba - 25%
- # 3. Naem = 10% ot pechalbata
- # 4. prowerka dali pechalbata shte stigen za ekskurziq
- trip_price = float(input())
- puzzles_count = int(input())
- dolls_count = int(input())
- bears_count = int(input())
- minions_count = int(input())
- trucks_count = int(input())
- #pechalba
- profit = (puzzles_count * 2.60) + (dolls_count * 3) + (bears_count * 4.10) + (minions_count * 8.20) + (trucks_count * 2)
- #otstypka
- total_count = puzzles_count + dolls_count + bears_count + minions_count + trucks_count
- if total_count >= 50:
- profit = profit - 0.25 * profit # 0.75 * profit
- #naem
- rent = profit * 0.10
- profit = profit - rent #profit -= rent
- # prowerka za ekskurziqta
- # ako parite sa dostatuchni -> profit >= trip_price
- if profit >= trip_price:
- left_money = profit - trip_price
- print(f"Yes! {left_money:.2f} lv left.")
- else:
- # ne sa dostatuchni
- # profit < trip_price
- need_money = trip_price - profit
- print(f"Not enough money! {need_money:.2f} lv needed.")
Advertisement
Add Comment
Please, Sign In to add comment