PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000058. Ngày hội chung của các chủng tộc (Eid)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Ngày hội chung của các chủng tộc (Eid)

Eid

Source: LightOJ

Version: Phuoc Hung OJ Extended

Problem Statement

On a planet, race i holds a feast once every x_i time units. All feast periods start from the same instant. A shared celebration happens whenever all races feast together. Find the positive time interval between consecutive shared celebrations. The result can exceed 64-bit integer range and must be printed without truncation.

Input

First line: n. Second line: n positive integers x_i.

Output

The exact positive integer time interval.

Subtasks

  • Subtask 1 (20 points): 2≤n≤82\le n\le 8, 1≤xi≤301\le x_i\le 30.
  • Subtask 2 (30 points): 2≤n≤1002\le n\le 100, 1≤xi≤10001\le x_i\le 1000.
  • Subtask 3 (50 points): 2≤n≤10002\le n\le 1000, 1≤xi≤100001\le x_i\le 10000.

Examples

Input

5
3 4 6 7 19

Output

1596

Explanation

The least common multiple of 3, 4, 6, 7, and 19 is 1596.