0130. Least Common Multiple

Input file name: lcm.in
Output file name: 1cm.out
Time limit: 500 ms
Memory limit: 64 megabytes

Calculate the least common multiple of all integers between 1 and n.

Input file

One integer 1 ≤ n ≤ 1000.

Output file

One integer.

Examples:

lcm.in1cm.out
36


Source: Petrozavodsk Summer 2003. Blitz Kontest, Monday, August 25
Author: Andrew Lopatin, Nick Durov

Discuss       Submit a solution



Printable version