#C7512. LCM Range
LCM Range
LCM Range
You are given two integers a and b (with a ≤ b). Your task is to compute the least common multiple (LCM) of all the integers in the range from a to b inclusive, and then output the result modulo \(10^9+7\).
The LCM of a set of integers is the smallest positive integer that is divisible by every number in that set. For example, the LCM of 1, 2, and 3 is 6.
Input Constraints: It is guaranteed that the numbers will be such that the LCM can be computed without overflow issues in intermediate calculations for the given problem constraints.
Examples:
- If a = 1 and b = 3, then the LCM of 1, 2, and 3 is 6.
- If a = 4 and b = 6, then the LCM of 4, 5, and 6 is 60.
- If a = 7 and b = 7, then the answer is simply 7.
You need to implement the solution such that it reads input from standard input (stdin) and outputs the answer to standard output (stdout).
inputFormat
The input consists of a single line containing two space-separated integers a and b (with a ≤ b).
outputFormat
Output a single integer representing the LCM of all integers from a to b (inclusive), taken modulo 10^9+7.## sample
1 3
6