#P4160. [SCOI2009] 生日快乐

    ID: 3093 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 6 上传者: 标签>动态规划,dp搜索2009四川各省省选深度优先搜索,DFS最大公约数,gcd

[SCOI2009] 生日快乐

Description

windy's birthday has arrived. To celebrate, his friends bought a rectangular cake with side lengths XX and YY.

Now, including windy, there are NN 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 NN pieces, windy must make N1N-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 NN pieces.

Can you help windy find this ratio?

Input Format

One line with three integers XX, YY, NN.

Output Format

One line with a floating-point number, rounded to 6 decimal places.

5 5 5
1.800000

Hint

For 100%100\% of the testdata, it holds that 1X,Y1041 \le X, Y \le 10^4, 1N101 \le N \le 10.

Translated by ChatGPT 5