#Q20. 「一本通 1.3 例 2」生日蛋糕

「一本通 1.3 例 2」生日蛋糕

Description

Mr. W wants to make an M-layer birthday cake with a volume of NπN\pi, where each layer is a cylinder.

Let the i-th layer of the cake from the bottom up be a cylinder with radius RiR_i and height HiH_i. For i<Mi < M, it is required that Ri>Ri+1R_i > R_{i+1} and Hi>Hi+1H_i > H_{i+1}. Since we need to apply cream to the cake, we want to minimize the surface area QQ of the cake (excluding the bottom surface of the lowest layer).

Let Q=SπQ = S\pi. For given NN and MM, write a program to find the cake's design (appropriate values of RiR_i and HiH_i) that minimizes SS. (All data above, except for QQ, are positive integers.)

birthdaycake.png

Input Format

The first line contains NN, indicating the cake's volume is NπN\pi.

The second line contains MM, indicating the number of layers in the cake.

Output Format

Output a single line with an integer SS (if no solution exists, output S=0S=0).

Sample 1

Note: Cylinder formulas: Volume V=πR2HV=\pi R^2H; Lateral surface area S=2πRHS’=2\pi RH; Base area S=πR2S=\pi R^2.

100
2

68

Data Range and Hints

For all data, 1N1041 \leq N \leq 10^4, 1M201 \leq M \leq 20.