#P1907E. Good Triples
Good Triples
No submission language available for this problem.
Description
Given a non-negative integer number (). Let's say a triple of non-negative integers is good if , and , where is the sum of digits of number .
For example, if , then the pair is good, because , and .
Your task is to find the number of good triples for the given number . The order of the numbers in a triple matters. For example, the triples and are two different triples.
The first line of input contains a single integer () — the number of test cases. Descriptions of test cases follow.
The first and only line of the test case contains one integer ().
For each test case output one integer, the number of good triples for the given integer . Order of integers in a triple matters.
Input
The first line of input contains a single integer () — the number of test cases. Descriptions of test cases follow.
The first and only line of the test case contains one integer ().
Output
For each test case output one integer, the number of good triples for the given integer . Order of integers in a triple matters.
Note
In the first example, the good triples are , , , , , , , , .
In the second example, there is only one good triple .