P29888 [洛谷] [LanQiao Cup 2016 Provincial AB] Maximum Ratio
普及+
题目描述

Problem Description

On Planet X, a certain grand prize competition offers $M$ levels of rewards. Each level's prize is a positive integer.

Moreover, the ratio between adjacent levels is a fixed value.

This means: the prize amounts for all levels form a geometric sequence. For example:

$$16, 24, 36, 54$$

The common ratio is: $3/2$.

Now, we have randomly surveyed some prize winners about their prize amounts.

Please calculate the possible maximum common ratio based on this information.

Input Format

The first line contains a number $N (0 < N < 100)$, indicating that the next line includes $N$ positive integers.

The second line contains $N$ positive integers $X_i (X_i < 10^{12})$, separated by spaces. Each integer represents the prize amount of a surveyed individual.

Output Format

A fraction in the form $A/B$, where $A$ and $B$ are coprime. This represents the possible maximum ratio coefficient.

The test data guarantees that the input format is correct and that the maximum ratio exists.

Sample Input and Output

Sample Input #1

3
1250 200 32

Sample Output #1

25/4

Sample Input #2

4
3125 32 32 200

Sample Output #2

5/2

Sample Input #3

3
549755813888 524288 2

Sample Output #3

4/1

Notes

Time limit: 3 seconds, Memory limit: 256MB. This problem is from the 7th LanQiao Cup 2016 Provincial Competition.

This problem is the J question of Group A (Group B) in the 2016 LanQiao Cup Provincial Competition.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3 1250 200 32
样例输出
25/4