#P8636. [蓝桥杯 2016 省 AB] 最大比例
[蓝桥杯 2016 省 AB] 最大比例
Description
A Grand Prix on Planet X offers 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:
Its common ratio is .
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 , indicating that the next line contains positive integers.
The second line contains positive integers , separated by spaces. Each integer represents the prize amount received by a surveyed person.
Output Format
Output a fraction in the form , where and are coprime, representing the maximum possible ratio coefficient.
The testdata guarantees that the input format is correct, and that the maximum ratio exists.
3
1250 200 32
25/4
4
3125 32 32 200
5/2
3
549755813888 524288 2
4/1
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
京公网安备 11011102002149号