Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/muzey-chiptasi

Museum ticket

Easy 1000 ms 64 MB 22%
Share

The full price of a museum ticket is $p$ soums. Children under $7$ ($a \lt 7$) enter for free, visitors aged $7$ to $17$ pay half the price, and visitors aged $18$ and older pay the full price. Find how many soums a visitor of age $a$ pays.

The age axis is split into three parts at 7 and 18; each part has its price: zero, half price, full price p

Input

One line with two integers: $a$ and $p$.

Output

One integer — the amount to pay.

Note

$0 \le a \le 120$
$2 \le p \le 10^{6}$
$p$ is even.

Examples

Input #1
12 30000
Output #1
15000
Input #2
18 30000
Output #2
30000

Sign in to submit a solution

Signing up is free and takes a minute.