LCM of 1 through n
Time limit2sMemory limit256 MB
Compute the least common multiple of all integers from 1 to n (n up to 10^8) and print it modulo 2^32.
- Level
Medium5 of 10
- Topics
- Number theory, Math
- Solved
- No attempts yet
Problem
Given a natural number , write a program that computes the least common multiple of every natural number from to .
Input
The first line contains ().
Output
Print the least common multiple of every natural number that is at least and at most . The answer can be very large, so print it modulo .