Problema

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Tony and his friends decided to rent a boat - the rent depends on the season and the number of

fishermen.

The price on the basis of season:

 Spring - 3000 $
 Summer and autumn - 4200 $
 Winter - 2600 $

The price on the basis of number of fishermen uses discount:

 If the group is up to 6 people (inclusive) - 10% discount


 If the group members are in range [7…11] - 15% discount
 If the group is 12 or more people - 25% discount

The fishermen use another 5 % discount if they are even number except when it is NOT
autumn – then they do NOT have additional discount.

Write a program to calculate whether the fishermen will gather enough money.

Input
The input is consists of exactly 3 lines:

 The budget of the group - real number in range [1…8000]


 Season - String : "Spring", "Summer", "Autumn", "Winter"
 Number of fishermen - integer in range [4…18]

Output
Print on the console a single line:

 If the budget IS enough: "Yes! You have {money left} dollars left."
 If the budget IS NOT enough: "Not enough money! You need {money needed} dollars."

The prices should be formatted to the second decimal point.

You might also like