All submissions for this problem are available.
One day Chef's father introduced him to prime numbers and taught him some of the properties of prime numbers. Chef became very fascinated with the prime numbers and started to do experiment with them. While experimenting he found that when he added 6 to some prime number the resulting number was also prime. He called these numbers Hex Prime numbers. He decided to count the number of Hex prime numbers under the range N and tell his father about it. But the process of counting such prime numbers are time-consuming and chef don't know how to write a program so asked you to help him write a program to count the number of Hex Prime numbers in a given upper range N(inclusive).
- The first line of the input contains an integer T denoting the number of Test Cases.
- For each test case, there is a Integer N denotes the given upper limit(inclusive).
- For each test case, output a single line containg the total numbers of Hex Prime within the range N
- 1 ≤ T ≤ 10 5
- 1 ≤ N ≤ 10 5
Input: 2 10 39 Output: 2 8
|Tags||ad-hoc, primenumbers, rahul_ojha_07, seive|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, COB, FS|
Fetching successful submissions