Mr. Seth decorates his shop with Paintings. He then planned to buy exactly K ones. He can buy them from a nearby shop and there are 2 types of Paintings available. The shop has a rule for customers that If anyone buys K paintings of type 1 then the customer must pay L * K2 and L1 *M2 if you buy M paintings of type 2. Please help Mr. Seth to buy exactly K paintings at a minimum amount of payment.
Input Format
Output Format
For each test case, print a single line containing the answer.
Constraints
Query 1: we have to buy exactly 5 paintings. There are six possible options:
So, the optimal cost is 17.