Given a value N. Find number of values X ( 1<=X<=N) which satisfy the equation.
X + S(F(X)) + S(F(S(F(X))) = N, where F(X) is a function which returns the product of digits of X, and S(X) is a function which returns sum of digits of X.
First line of test case contains an integer T, denoting number of the test cases. Each line of the test case contains an integer N.
For each of the test case print the answer in separate line.
1 <= T <= 104
1 <= N <= 105
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.