~/algor $ cat problems/sonlar-katta-oraliqdagi-tublar
Primes in a large segment
Medium
1000 ms
128 MB
58%
You are given two positive integers $l$ and $r$. How many primes are there from $l$ to $r$ (inclusive)? The numbers are large, but the segment is not very long.
Input
One line with two positive integers: $l$ and $r$.
Output
One integer — the number of primes in the segment.
Note
$1 \le l \le r \le 10^{12}$
$r - l \le 10^{5}$
Examples
Input #1
10 30
Output #1
6
Input #2
1 1
Output #2
0