Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- r = int(input())
- s = int(input())
- c = int(input())
- max_juice = int(input())
- juice = 0
- raspberries = 0
- strawberries = 0
- cherries = 0
- for j in range(r + 1):
- for k in range(s + 1):
- for l in range(c + 1):
- current_juice = 4.5 * j + 7.5 * k + 15 * l
- if juice < current_juice <= max_juice:
- juice = current_juice
- raspberries = j
- strawberries = k
- cherries = l
- print(f"{raspberries} Raspberries, {strawberries} Strawberries, {cherries} Cherries. Juice: {int(juice)} ml.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement