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

#GL0000046. Bội chung dương nhỏ nhất của nhiều số (Smallest Multiple)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Bội chung dương nhỏ nhất của nhiều số (Smallest Multiple)

Smallest Multiple

Source: Kattis

Version: Phuoc Hung OJ Extended

Problem Statement

Given a single line of NN positive integers, find their least positive common multiple. The answer may exceed 64-bit integer capacity; print all of its decimal digits exactly.

Input

One line with NN positive integers aia_i, separated by spaces; no leading count NN.

Output

Print the exact decimal LCM.

Subtasks

  • Subtask 1 (20 points): 1≤N≤51 \le N \le 5; 1≤ai≤1001 \le a_i \le 100 (Phuoc Hung OJ version bound)
  • Subtask 2 (30 points): 1≤N≤151 \le N \le 15; 1≤ai≤1051 \le a_i \le 10^{5} (Phuoc Hung OJ version bound)
  • Subtask 3 (50 points): 1≤N≤401 \le N \le 40; 1≤ai≤1091 \le a_i \le 10^{9} (Phuoc Hung OJ version bound)

Examples

Input

4 6 10

Output

60

Explanation

The LCM of 4,64,6 is 1212; taking the LCM with 1010 yields 6060.