#P1865. Count Primes in Interval

    ID: 15148 Type: Default 1000ms 256MiB

Count Primes in Interval

Count Primes in Interval

Given two integers \(l\) and \(r\), count the number of prime numbers in the interval \([l, r]\).

A prime number is an integer greater than 1 that has no positive divisors other than 1 and itself.

inputFormat

The input consists of a single line with two space-separated integers \(l\) and \(r\) (\(l \leq r\)).

outputFormat

Output a single integer representing the number of prime numbers in the interval \([l, r]\).

sample

1 10
4