本站作为LDUOnlineJudge的测试版本进行演示,官方网站请访问http://icpc.ldu.edu.cn
[Hidden]

1331. A. Buying in Bulk


Description

To encourage customers to shop more, some stores charge lower prices if you buy multiples of an item. For example, if you buy one, it may cost you $5 but if you buy two, it will cost you $8 instead of $10. 


The Problem:
Let’s assume a store provides discounts as follows:
    1. No discount if you buy only one.
    2. $2 discount for each additional item if you buy more than one. Given the number of items a customer has purchased and the price for one item, you are to compute the total cost for the customer. 
 

Input

There is one input line, it provides two integers: the first integer c (1 ≤ c ≤ 100) is the number of items purchased by the customer, and the second integer p (3 ≤ p ≤ 50) is the price for one item.

Output

Print the total cost for the customer on a line by itself with no leading or trailing spaces.

Samples

Input Copy
1 5
Output
5

Source

UCF2019 PRACTICE
Problem Information

Time Limit: 1000MS (C/C++,Others×2)
Memory Limit: 128MB (C/C++,Others×2)
Special Judge: No
AC/Submit: 14 / 15
Tags:
Contests involved

1037. UCF 2019 Practice
My history solutions

You didn't submit any solution!
Submit your solution

Login Register