P8636 [Lanquiao Cup 2016 NOI Qualifier AB] Maximum Ratio.
Description
A Grand Prix on Planet X offers $M$ levels of prizes. The prize money at each level is a positive integer.
Moreover, the ratio between two adjacent levels is a fixed value.
That is, the prize amounts for all levels form a geometric sequence. For example:
$$16,24,36,54$$
Its common ratio is $3/2$.
Now, we randomly surveyed the prize amounts of some winners.
Based on this, please infer the maximum possible common ratio.
Input Format
The first line contains an integer $N(0
Output Format
Output a fraction in the form $A/B$, where $A$ and $B$ are coprime, representing the maximum possible ratio coefficient.
The testdata guarantees that the input format is correct, and that the maximum ratio exists.
Explanation/Hint
Time limit: 3 seconds, 256M. The 7th Lanqiao Cup provincial contest in 2016.
Lanqiao Cup 2016 provincial contest Group A Problem J (Group B Problem J).
Translated by ChatGPT 5