PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#SCKTIFELSE0000004. Tính tiền vé tham quan (Admission Ticket Price)

Bài tập này chưa được xếp vào lộ trình.

Tính tiền vé tham quan (Admission Ticket Price)

Admission Ticket Price

Version: Phuoc Hung OJ Extended

Problem Statement

An amusement park sells three ticket categories. Category 11 has a base price of 100000100000 VND, category 22 costs 150000150000 VND, and category 33 costs 200000200000 VND. The payable amount also depends on age: customers younger than 66 enter free; those aged 66 through 1717 pay 50%50\% of the base price; those aged 1818 through 5959 pay 100%100\%; and those aged 6060 or older pay 70%70\%. Given the ticket category and a customer’s age, calculate the amount due.

Input

A single line contains two integers loai_ve and tuoi, separated by a space. loai_ve is the ticket category and tuoi is the customer age.

Output

Print one integer giving the amount due in Vietnamese dong, without a currency symbol or thousands separators.

Subtasks

  • Subtask 1 (20 points): loai_ve=1\texttt{loai\_ve}=1; 0≤tuoi≤170\le\texttt{tuoi}\le17

  • Subtask 2 (30 points): 1≤loai_ve≤21\le\texttt{loai\_ve}\le2; 0≤tuoi≤590\le\texttt{tuoi}\le59

  • Subtask 3 (50 points): 1≤loai_ve≤31\le\texttt{loai\_ve}\le3; 0≤tuoi≤1200\le\texttt{tuoi}\le120

Examples

Example 1

Input

1 5

Output

0

Explanation

Category 11 costs 100000100000 VND, but a 5-year-old enters free and pays 00.

Example 2

Input

2 16

Output

75000

Explanation

Category 22 costs 150000150000 VND; a 16-year-old pays 50%50\%, or 150000×50/100=75000150000\times50/100=75000 VND.

Example 3

Input

3 64

Output

140000

Explanation

Category 33 costs 200000200000 VND; a 64-year-old pays 70%70\%, or 200000×70/100=140000200000\times70/100=140000 VND.