P12702 [HackerEarth] ashu and prime factors 4
普及
题目描述

Ashu is very fond of Prime numbers and he like challenging his friends by giving them various problems based on Mathematics and Prime number. One of his friend Harshit is jealous and challenges him to solve a task. Task is :Given a prime number X, you need to give the count of all numbers in range 1 to 10^6 inclusive which have minimum prime factor X.Help Ashu in solving this task.Input:First line consist of numer of test cases T.Each test case contains a single number X.Output:Output for each test case count of all numbers in range 1 to 10^6 inclusive which have minimum prime factor X.Constraints:1 ≤ T ≤ 10^5Prime number X where 2 ≤ X ≤ 10^6

SAMPLE INPUT
2
2
11

SAMPLE OUTPUT
500000
20779

Explanation

The minimum prime factor of all even numbers in the range [2, 1000000] is 2, and there are 1000000/2 = 500000 such even numbers.
The numbers with minimum prime factor as 11 are: 11, 121, 143, ...

输入格式

见题面

输出格式

见题面

样例输入
2 2 11 SAMPLE
样例输出
500000 20779