Harmonic Mean

The harmonic mean (HN ) of N numbers a1, a2, a3 . . . aN−1, aN is defined as below: HN = N 1+1+1+...+ 1 +1 a1 a2 a3 aN−1 aN So the harmonic mean of four numbers a, b, c, d is defined as H4= 4 a1 +1b +1c +d1 In this problem your job is very simple: given N (0 < N < 9) integers you will have to find their harmonic mean. Input The first line of the input file contains an integer S (0 < S < 501), which indicates how many sets of inputs are there. Each of the next S lines contains one set of input. The description of each set is given below: Each set starts with an integer N (0 < N < 9), which indicates how many numbers are there in this set. This number is followed by N integers a1, a2, a3 . . . aN−1, aN (0 < ai < 101). Output For each set of input produce one line of output. This line contains the serial of output followed by two integers m and n separated by a front slash. These two numbers actually indicate that the harmonic mean of the given four numbers is mn . You must ensure that gcd(m, n) = 1 or in other words m and n must be relative prime. The value of m and n will fit into a 64-bit signed integer. Sample Input 2 41234 42231 Sample Output Case 1: 48/25 Case 2: 12/7