import sys
from math import sqrt

def parseInt(stream):
    return int(stream.readline().rstrip())

def getWays(N):
    if(N >= 4):
        f = [0] *(N + 1)
        f[1] = 1
        f[2] = 1
        f[3] = 1
        f[4] = 2
        for i in range(5 , N + 1):
            f[i] = f[i - 1] + f[i - 4]
        return f[N]
    else:
        if(N < 4):
            return 1
        else:
            return 2
       

def getPrimes(N):
    primeSet = set()
    for i in range(2,N + 1):
        if(isPrime(i)):
            primeSet.add(i)
    return len(primeSet)

def isPrime(num):
    for i in range(2,int(sqrt(num) + 1 )):
        if(num % i == 0):
            return False
    return True
            
if __name__ == "__main__":
    stream = sys.stdin
    T = parseInt(stream)
    for i in range(T):
        N = parseInt(stream)
        NWays = getWays(N)
        NPrimes = getPrimes(NWays)
        result = NPrimes
        print result
            

@@ -1,16 +1,47 @@
+# Importing standard libraries%0A
 import sys%0Afrom 
@@ -62,73 +62,476 @@
 rt%0A%0A
-def parseInt(stream):%0A    return int(stream.readline().rstrip())%0A
+# Parsing Functions%0A'''%0A    Parses an single integer on a line from given stream be it a file or %0A    the standard input.%0A'''%0Adef parseInt(stream):%0A    return int(stream.readline().rstrip())%0A%0A%0A%0A'''%0A    Getting the number of ways. This follows the recurrence relation, which%0A    is T(n) = T(n-1) + T(n-4). T(n-1) is the term when we put a vertical%0A    block in the nth socket and T(n-4) is the term when we put a horizontal%0A    block in the n-3 through n th socket.%0A'''
 %0Adef
@@ -839,16 +839,83 @@
        %0A
+'''%0A    Returns number of prime numbers less than or equal to N%0A'''
 %0Adef get
@@ -1053,16 +1053,65 @@
 meSet)%0A%0A
+'''%0A    Tests if a number is a prime number.%0A'''%0A
 def isPr
@@ -1235,24 +1235,65 @@
 ue%0A         
+%0A# Main function for the program         
    %0Aif __nam

Update RedJohnIsBack.py