GO Solution For UVa 10680 - LCM. In this post we will see how we can solve this challenge in GoLang for UVa Online Judge.

Problem Description

All of you know about LCM (Least Common Multiple). For example LCM of 4 and 6 is 12. LCM can also be defined for more than 2 integers. LCM of 2, 3, 5 is 30. In the same way we can define LCM of first N integers. The LCM of first 6 numbers is 60.

As you will see LCM will increase rapidly with N . So

...

You can find the full details of the problem LCM at UVa Online Judge

Sample Input

3
5
10
0

Sample Output

6
6
2

Solution: Please check the main.go snippet for the solution.

Solution originally posted at: Github by @codingsince1985