Time limit
2s
Memory limit
128 MB
For N natural numbers A[1], ..., A[N], this problem defines the harmonic average as the following value.
1 / (1/A\[1] + 1/A\[2] + ... + 1/A\[N])
In other words, take the reciprocal of each number, add those reciprocals, and then take the reciprocal of that sum. For 1, 2, and 4, the value is 4/7.
Given N natural numbers A[1], ..., A[N], write a program that prints the harmonic average according to this definition.
The first line contains a natural number N (1 <= N <= 9).
The second line contains A[1], ..., A[N] in order. Each A[i] is a natural number not greater than 100.
Print the answer as a fraction on the first line.
If the same value can be represented in multiple ways, print the representation that uses the fewest total characters among digits and /. If there is more than one such representation, print the lexicographically smallest one.
The usual harmonic mean is N / (1/A\[1] + 1/A\[2] + ... + 1/A\[N]), but in this problem, the value defined in the statement is called the harmonic average.