4000 - How many primes? 4000 - ¿Cuántos primos? 4000 - How many primes?

Statistics Sub: 125 | AC: 47 | AC%: 37,60 | Score: 2,50
Created by Reinier Rodríguez González
Added by Spartan (2018-05-18)
Limits
Total Time: 30000 MS | Test Time: 8000 MS |Memory: 512 MB | Output: 64 MB | Size: 9 KB
Enabled languages
Available in

Description

Several times you will be given two integers A and B (1 <= A <= B <= 5*10^7), print the amount of prime numbers in the range [A, B].
En varias ocasiones, se le darán dos enteros A y B (1 <= A <= B <= 5*10^7), imprima la cantidad de números primos en el rango [A, B].
Several times you will be given two integers A and B (1 <= A <= B <= 5*10^7), print the amount of prime numbers in the range [A, B].

Input specification

T (0 < T < 10^6), the numbers of test cases.
Then T lines will follow, each containing two integers A, B; those described above.
(0 < T < 10^6), el número de casos de prueba.
Luego seguirán T líneas, cada una conteniendo dos enteros A y B, descritos arriba.
T (0 < T < 10^6), the numbers of test cases.
Then T lines will follow, each containing two integers A, B; those described above.

Output specification

For each line, except the first, you must print, in one single line, the amount of prime numbers in the given range, following this format:
Test Case #<test-number>: <amount> (<test-number> must be changed by the corresponding test case number and <amount> must be changed by the required amount of prime numbers)
Para cada línea, excepto la primera, deberá imprimir, en una sola línea, la cantidad de números primos en el rango dado, siguiendo el siguiente formato:
Test Case #: ( deberá ser sustituido por el número del caso de prueba correspondiente y deberá ser cambiado por la cantidad requerida de número primos).
T (0 < T < 10^6), the numbers of test cases.
Then T lines will follow, each containing two integers A, B; those described above.

Sample input

3
1 3
5 5
6 10

Sample output

Test Case #1: 2
Test Case #2: 1
Test Case #3: 1

Hint(s)

http://coj.uci.cu/24h/
http://coj.uci.cu/24h/

Recommendation

We have carefully selected several similar problems: 3379 | 3378 | 3377 | 2916 | 3954 | 3303