sprime
Time Limit: 2 sec
Memory Limit: 128000 kB
Problem Statement
Sara has developed a new algorithm to find sprime for a given range starting with 2
She will start from the end mark it sprime, and mark all its factors (excluding itself) as not sprime. Then she will find the next greatest unmarked number, mark it as sprime, and mark all its factors (excluding itself) as not sprime
Your task is to calculate the the number of sprimes that are actually prime
Input
The first line contains T the number of test cases.
Each of the next T lines contain an integer n.
Constraint:-
1 <= T <= 100
2 <= n <= 10000000
Output
Output T lines, one for each test case, containing the required answer.
Comments
Leave a comment