Under construction

Still being built. Things may change

Astronomy

Time limit2sMemory limit128 MB

Summary
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 nn 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 nn 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 nn — the number of planets (2≤n≤10002 \le n \le 1000).

The second line contains nn integers tit_i — the orbital periods of the planets (1≤ti≤100001 \le t_i \le 10000). Not all tit_i are equal.

Output

Output the answer as an irreducible common fraction: the numerator and the denominator separated by a single space.

Hint

Examples2

  1. Example 1

    Input
    3
    6 2 3
    
    Expected output
    3 1
    
  2. Example 2

    Input
    2
    3 9
    
    Expected output
    9 4