#Lutece2829. 生日蛋糕

生日蛋糕

Migrated from Lutece 2829 生日蛋糕

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

瓜皮大哥想要定做一个生日蛋糕。

生日蛋糕是一个体积为 n×πn \times \pimm 层蛋糕,每层都是一个圆柱体。

设从下往上数第 ii 个蛋糕是半径为 RiR_i ,高度为 HiH_i 的圆柱。当 i<mi < m 时,要求 Ri>Ri+1R_i > R_{i+1}Hi>Hi+1H_i > H_{i+1}。由于要在蛋糕上抹奶油,为尽可能节约经费,我们希望蛋糕外表面(最下一层的下底面除外)的面积 QQ 最小。

Q=S×πQ=S \times \pi,请编程对给出的 nnmm ,找出蛋糕的制作方案(适当的 RiR_iHiH_i 的值),使 SS 最小。(除 QQ 外,以上所有数据皆为正整数)

Input

第一行为 nn ,表示待制作的蛋糕的体积为 n×πn \times \pi

第二行为 mm ,表示蛋糕的层数为 mm

Output

输出一个整数 SS(若无解则 S=0S=0

Samples

100
2
68

Constraints

1n104,1m201 \le n \le 10^4 , 1 \le m \le 20

Resources

2022 UESTC ICPC Training for String and Search Algorithm