One of Tommy’s family members is planning a trip to an amusement park, and Tommy is interested in calculating the cost of a ticket based on the park's pricing guidelines. The amusement park offers different ticket rates for visitors of various ages and weights.
Here are the established guidelines for pricing:
Children who are under years of age and individuals aged or older are granted free tickets.
Children falling within the age range of to years qualify for a child's ticket priced at
Teenagers and adults, aged to can acquire a regular ticket for
Anyone within the age range of to is eligible for a senior ticket, which costs
If a visitor is between and years old and has a weight more then kg, they are entitled to a discounted ticket priced at
Now, let's develop a program that takes as input the age and weight of the visitor and calculates the admission ticket price according to the amusement park's rules.
The program expects the age in years and weight in kilograms of the visitor, both represented as integers on the first line.
If the admission ticket cost is , the program will print "Free" in a single line. Otherwise, it will display the ticket price.
Input | Output |
---|---|
2 9 | Free |
Input | Output |
---|---|
13 39 | 20 |
Be careful about the new line (‘\n’) at the end.