#atcoderABC070C. Multiple Clocks
Multiple Clocks
Problem Statement
We have clocks. The hand of the -th clock rotates through in exactly 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
- All input values are integers.
- The correct answer is at most seconds.
Input
Input is given from Standard Input in the following format:
Output
Print the number of seconds after which the hand of every clock point directly upward again.
Input 1
2
2
3
Output 1
6
We have two clocks. The time when the hand of each clock points upward is as follows:
- Clock : , , , seconds after the beginning
- Clock : , , , seconds after the beginning
Therefore, it takes seconds until the hands of both clocks point directly upward.
Input 2
5
2
5
10
1000000000000000000
1000000000000000000
Output 2
1000000000000000000