Тавсифи масъала
A number is called beautiful if it can be represented in the form , where and are prime numbers. For example, is beautiful, is beautiful, but and are not beautiful.
You are given queries. In each query, you are given a number . Your task is to find how many beautiful numbers exist in the range .
Input Format
The first line contains a single integer .
The second line contains integers --- the value for each query.
Output Format
For each of the queries, print the answer separated by spaces.
Scoring
| Subtask | Constraint | Points |
|---|---|---|
| , | ||
Notes
In the first sample, for : there are beautiful numbers in ; for : there is beautiful number (); for : there are beautiful numbers (, , ).
In the second sample, for : there are beautiful numbers.
Мисолҳо
Мисол 1
Вуруд
3 3 7 10
Баромад
0 1 3
Мисол 2
Вуруд
1 40
Баромад
6