Day 2 Question 1

High Tide

Input file: probd.in

Output file: probd.out

A planet has n moons revolving about it in constant clockwise coplanar circular orbits. How often do all the moons appear directly overhead as viewed from some point on the planet? We will call such a situation a 'vertical alignment'.

Your input consists of a number of sets of lines; each set consists of an integer n, indicating the number of moons, followed by n distinct positive integers, one per line, indicating the exact period of revolution for each moon, in days. (Thus there are n+1 lines of data for each set with the first line containing n.) The last line contains only a zero.

For each input set, except the last, generate a line of output indicating the interval in days, to two decimal places, between consecutive vertical alignments.

Sample Input

2
20
30
3
20
30
40
2
10
3
0

Sample Output

60.00
120.00
4.29