题目描述
Problem Description
Xiao Yang's class has a total of $n$ students, each with their own exercise habits. Specifically, the $i$-th student exercises every $a_i$ days (meaning that each exercise session is $a_i$ days after the previous one). One day, all $n$ students in the class happen to come for exercise. They are thrilled and want to calculate how many days it will be until all of them exercise together again. They don't know how to calculate this, can you help them?
Input Format
The first line contains an integer $n$, representing the number of students.
The second line contains $n$ space-separated positive integers, $a_0, a_1, \ldots, a_{n-1}$, in order.
Output Format
Output a single integer, representing the minimum number of days until all students exercise together again.
Sample Input and Output
Sample Input #1
3
1 2 3
Sample Output #1
6
Sample Input #2
4
2 4 8 16
Sample Output #2
16
Sample Input #3
4
2 4 6 8
Sample Output #3
24
Notes
Sample 1 Explanation
The first student exercises every day; the second student exercises every 2 days; the third student exercises every 3 days. Therefore, after 6 days, all three students will exercise together. Before this, the second student only exercises on days 2 and 4, and the third student only on day 3, so they do not meet.
Sample 2 Explanation
The fourth student exercises every 16 days, and 16 days later is also when the first three students exercise.
Data Size and Constraints
- For $20\%$ of the data, $n = 2$.
- For $50\%$ of the data, $n = 4$.
- For $100\%$ of the data, $2 \leq n \leq 10$, $1 \leq a_i \leq 50$.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分