Please enter your email address or userHandle.
Given an integer N, the task is to find out the count of numbers M that satisfy the condition M + sum(M) + sum (sum(M)) = N, where sum(M) denotes the sum of digits in M.
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains a number N as input.
For each test case, print the count of numbers in new line.
1 <= T <= 500
1 <= N <= 109
Only 1 positive integer satisfies the condition that is 3,
3 + sum(3) + sum(sum(3)) = 3 + 3 + 3 = 9
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Login to access your submissions.
Please choose 'ReadOnlyMode' if you needn't to 'Edit' the problem e.g. viewing OJ's solution, TestCase Files (TCFs), TimeLimit etc.