InGenious Genie 2
Yet again, they come across the same genie who now holds a number lock of 4 digits and won't let them pass him unless they give him the correct pattern of the lock. The four digits of the lock are p, q, r, s; which are the unit digits of the answers to 4 questions which he is going to ask.
Question for P = (the no of primes less than or equal to a given integer, n) - 1.
Question for Q= (the sum of primes less than or equal to n) - 2.
Question for R = (the sum of odd primes less than or equal to n) - 1.
Question for S = (the sum of even primes less than or equal to n) - 2.
Help them give the genie the correct numbers for them to go to the next level.
Input format:
The first line of input contains t, the number of test cases. Each line of a test case contains a single integer n.
Output format:
Print t lines, the answers to the t testcases.
Each line should contain 4 integers p, q, r, s which are the unit digits of the answers to 4 questions which he is going to ask.
Constraints:
1 <= t <= 10
3 <= n <= \(10^4\)
For 30% of the testcases
3 <= n <= \(10^2\)
For the remaining testcases:
Original constraints.
Sample input:
2
7
20
Sample output:
3 5 4 0
7 5 4 0
Comments
t=int(input()) if t>=1 and t<=104: for i in range(0,t): n=int(input()) if n>=3 and n<=1018: prime=[] for j in range(2,n+1):
"""
Output is 14 6 5 0
11 5 4 0
17 9 8 0
22 2 1 0
15 9 8 0
But some of the outputs get printed twice.