100 #ABC070C. [ABC070C] Multiple Clocks

[ABC070C] Multiple Clocks

Score : 300300 points

Problem Statement

We have NN clocks. The hand of the ii-th clock (1iN)(1 \leq i \leq N) rotates through 360360^\circ in exactly TiT_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point directly upward again?

Constraints

  • 1N1001 \leq N \leq 100
  • 1Ti10181 \leq T_i \leq 10^{18}
  • All input values are integers.
  • The correct answer is at most 101810^{18} seconds.

Input

Input is given from Standard Input in the following format:

NN

T1T_1

::

TNT_N

Output

Print the number of seconds after which the hand of every clock point directly upward again.

2
2
3
6

We have two clocks. The time when the hand of each clock points upward is as follows:

  • Clock 11: 22, 44, 66, ...... seconds after the beginning
  • Clock 22: 33, 66, 99, ...... seconds after the beginning

Therefore, it takes 66 seconds until the hands of both clocks point directly upward.

5
2
5
10
1000000000000000000
1000000000000000000
1000000000000000000