Processing math: 100%
Segmented sieve - MarisaOJ: Marisa Online Judge

Segmented sieve

Time limit: 1000 ms
Memory limit: 256 MB
Given an 2 integers L,R. Find all primes in range [L,R]. ### Input - The first line contains 2 integers L,R. ### Output - Print all primes in range [L,R] in ascending order. ### Constraints - 1≤L≤R≤1012. - 1≤R−L+1≤106. ### Example Input: 2030 Output: 2329