P4160 [SCOI2009] Happy Birthday
Description
windy's birthday has arrived. To celebrate, his friends bought a rectangular cake with side lengths $X$ and $Y$.
Now, including windy, there are $N$ people to share this big cake, and each person must receive the same area.
windy makes the cuts. Each cut must be parallel to one of the cake's sides (either side), and it must split the piece being cut into two pieces.
Thus, to obtain $N$ pieces, windy must make $N-1$ cuts.
To make each piece look nice, we want to minimize the maximum ratio of the long side to the short side among the $N$ pieces.
Can you help windy find this ratio?
Input Format
One line with three integers $X$, $Y$, $N$.
Output Format
One line with a floating-point number, rounded to 6 decimal places.
Explanation/Hint
For $100\%$ of the testdata, it holds that $1 \le X, Y \le 10^4$, $1 \le N \le 10$.
Translated by ChatGPT 5