Emblem (Emblem)
Before the N-th fair "Microtechnologies in Macroprogramming," designers created an emblem featuring a series of squares. The largest square measures N×N dm, with each subsequent square decreasing in size by one dm, down to a 1×1 dm square at the top. The organizers appreciated the emblem but decided to enhance it with a golden ribbon. This ribbon would stretch from the bottom left corner to the top right corner, then run along the top edge, and finally descend to the bottom right corner (refer to the illustration).
The ribbon is available for purchase at a nearby store for P UAH per dm, but it is sold only in whole dm increments. The store offers a 10% discount for purchases totaling at least 100 UAH and a 15% discount for purchases of 1000 UAH or more. What is the minimum amount that needs to be paid for this "decoration"?
Remember, on the Cartesian plane, the length of a segment between points (x1, y1) and (x2, y2) is calculated using the formula: ( d = \sqrt{(x2 - x1)^2 + (y2 - y1)^2} ).
Input Data
The program receives two natural numbers: N – the fair number, and P – the price of the ribbon in UAH per dm (1 ≤ N ≤ 100).
Output Data
Output the price of the ribbon in kopecks (to avoid dealing with fractional numbers).