Jackpot

No attempts yetTime limit2sMemory limit64 MB

Problem

The Great Dodgers company has recently built a brand-new slot machine.

You insert a coin and pull the handle. The machine then picks an integer. If the picked number is 00, you win the jackpot. Otherwise the machine divides the picked number by each of the lucky numbers p1,p2,,pnp_1, p_2, \dots, p_n; if at least one of these divisions leaves remainder 00, you win.

Great Dodgers want to know the probability of winning. Probability theory does not let us assume that every integer is equally likely, but a mathematician suggested that the winning probability can be approximated by the limit

limkSk2k+1,\lim_{k \to \infty} \frac{S_k}{2k+1},

where SkS_k is the number of integers between k-k and kk (inclusive) that are divisible by at least one of the lucky numbers. Write a program that computes this probability.

Input

The input contains nn, the number of lucky numbers (1n161 \le n \le 16), followed by the nn lucky numbers p1,,pnp_1, \dots, p_n (1pi1091 \le p_i \le 10^9). The values may be separated by spaces or newlines.

Output

The requested probability is rational. Output it as an irreducible fraction: print the numerator on the first line and the denominator on the second line. Both must be printed without leading zeroes, and the fraction must be fully reduced.