#P1731. [NOI1999] 生日蛋糕
[NOI1999] 生日蛋糕
Description
July 17 is Mr. W’s birthday. To celebrate, ACM-THU plans to make an -layer birthday cake with volume , where each layer is a cylinder.
Let the -th layer from bottom to top () be a cylinder with radius and height . For , it is required that and .
Since the cake needs to be frosted, to save cost as much as possible, we want the area of the cake’s outer surface (excluding the bottom face of the lowest layer) to be minimized.
Given and , write a program to find a construction of the cake (appropriate values of and ) that minimizes .
(Except for , all the quantities above are positive integers.)
Input Format
The first line contains an integer (), indicating that the cake’s volume is .
The second line contains (), the number of layers of the cake.
Output Format
Output an integer . If there is no solution, output .
100
2
68
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号