#P5946. Count B‑smooth Numbers in an Interval
Count B‑smooth Numbers in an Interval
Count B‑smooth Numbers in an Interval
Given a positive integer \(B\), a natural number \(n\) is called B‑smooth if none of its prime factors exceed \(B\). Equivalently, \(n\) is B‑smooth if it can be represented as a product of positive integers each no greater than \(B\). Given a closed interval \([n, n+m]\), your task is to count the number of B‑smooth numbers within that interval.
inputFormat
The input consists of three space‐separated integers: \(n\), \(m\), and \(B\). The interval to be considered is \([n, n+m]\).
outputFormat
Output a single integer: the count of B‑smooth numbers in the interval \([n, n+m]\).
sample
1 10 5
9