P5753 [NOI2000] Porcelain Disc Necklace
Description
A primitive tribe uses a rare kind of clay to fire circular porcelain discs of the same thickness and string them into a necklace. When stringing, the discs are connected in order along their diameters. There are no gaps and no overlaps between adjacent discs. A necklace consists of at least one disc.
The figure below shows a necklace made by stringing four discs of the same size. Its total length is four times the diameter of a single disc.

For each fired disc, the thickness is fixed, and the diameter $D$ and the volume of clay used $V$ satisfy:
$$D = \begin{cases}
0.3\sqrt{V-V_0} & V > V_0 \cr
0 & V \le V_0
\end{cases}$$
Here $V_0$ is the loss (waste) incurred when firing each disc, with the same unit as $V$. If the amount of clay used is less than or equal to $V_0$, a disc cannot be produced.
Example: $V_总 = 10,V_0 = 1$.
If you fire one disc, $V = V_总 = 10$, so $D = 0.9$.
If you divide the clay evenly into $2$ parts, each part has volume $V = \frac{V_总}{2} = 5$, and the diameter of one disc is $D' = 0.3 \times \sqrt{5-1} = 0.6$. Then the total length when strung is $1.2$.
Given the total volume of clay and the loss for firing a single disc, different numbers of discs lead to different total necklace lengths. Compute how many discs should be fired to make the necklace as long as possible.
Input Format
Two lines in total, each line contains one integer.
The first line is the total volume of clay $V_总$ ($0 < V_总 < 60000$). The second line is the loss per disc $V_0$ ($0 < V_0 < 600$).
Output Format
One line containing one integer.
This integer is the number of discs to fire in order to obtain the longest necklace. If it is impossible to fire any disc, or if the optimal solution is not unique (there exist two or more choices that all achieve the maximum necklace length), output `0`.
Explanation/Hint
Translated by ChatGPT 5