func main() var n: int :: cui@inputInt() - 1 var l: int :: cui@inputInt() var max: int :: l / n var isPrime: []bool :: @sieve(max) var ans: int :: 0 for p(2, max) if(isPrime[p]) do ans :+ l - p * n + 1 end if end for do cui@print("\{ans}\n") end func func sieve(n: int): []bool if(n < 2) ret [false].repeat(n + 1) end if var isPrime: []bool :: [false, false] ~ [true].repeat(n - 1) for i(2, n) if(isPrime[i]) var j: int :: i * i while(j <= n) do isPrime[j] :: false do j :+ i end while end if end for ret isPrime end func