#P8636. [蓝桥杯 2016 省 AB] 最大比例

[蓝桥杯 2016 省 AB] 最大比例

Description

A Grand Prix on Planet X offers MM 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,5416,24,36,54

Its common ratio is 3/23/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<N<100)N(0<N<100), indicating that the next line contains NN positive integers.

The second line contains NN positive integers Xi(Xi<1012)X_i(X_i<10^{12}), separated by spaces. Each integer represents the prize amount received by a surveyed person.

Output Format

Output a fraction in the form A/BA/B, where AA and BB 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