Astronomy
Time limit2sMemory limit128 MB
Given orbital periods of n planets moving on circular orbits, compute the exact fractional time interval between consecutive moments all planets and the star are collinear.
- Level
Medium6 of 10
- Topics
- Math, Number theory, Geometry
- Solved
- No attempts yet
Problem
There are planets in the planetary system of star X. They all orbit star X along circular orbits lying in the same plane, and each planet moves with a constant tangential speed. All planets orbit in the same direction.
Occasionally an event called a planet parade occurs: the moment when all planets and star X lie on a single straight line.
Find the length of the time interval between two consecutive planet parades.
Input
The first line contains an integer — the number of planets ().
The second line contains integers — the orbital periods of the planets (). Not all are equal.
Output
Output the answer as an irreducible common fraction: the numerator and the denominator separated by a single space.
Hint
