#K13866. Ticket Pricing

    ID: 24008 Type: Default 1000ms 256MiB

Ticket Pricing

Ticket Pricing

You are required to compute the ticket price for an event attendee based on their age and the full ticket price \( C \). The full ticket price is guaranteed to be an even number. The final ticket price is determined using the following rules:

  • If the attendee is at least 18 years old, they pay the full price: \( C \).
  • If the attendee is between 13 and 17 years old (inclusive), they pay half of \( C \): \( \frac{C}{2} \).
  • If the attendee is between 6 and 12 years old (inclusive), they pay a quarter of \( C \): \( \frac{C}{4} \).
  • If the attendee is 5 years old or younger, the ticket is free.

Your task is to implement a program that reads the attendee's age and the full ticket price from standard input and prints the calculated ticket price to standard output.

inputFormat

The input consists of a single line containing two space-separated integers:

  • The first integer represents the age of the attendee (\(age \ge 0\)).
  • The second integer represents the full ticket price \(C\) (an even number).

outputFormat

Output a single integer representing the calculated ticket price based on the rules provided.

## sample
20 200
200