#P1567C. Carrying Conundrum
Carrying Conundrum
No submission language available for this problem.
Description
Alice has just learned addition. However, she hasn't learned the concept of "carrying" fully — instead of carrying to the next column, she carries to the column two columns to the left.
For example, the regular way to evaluate the sum would be as shown:

However, Alice evaluates it as shown:

In particular, this is what she does:
- add and to make , and carry the to the column two columns to the left, i. e. to the column " ";
- add and to make and carry the to the column two columns to the left, i. e. to the column " ";
- add , , and to make and carry the to the column two columns to the left, i. e. to the column above the plus sign;
- add , and to make ;
- add to make .
Alice comes up to Bob and says that she has added two numbers to get a result of . However, Bob knows that Alice adds in her own way. Help Bob find the number of ordered pairs of positive integers such that when Alice adds them, she will get a result of . Note that pairs and are considered different if .
The input consists of multiple test cases. The first line contains an integer () — the number of test cases. The description of the test cases follows.
The only line of each test case contains an integer () — the number Alice shows Bob.
For each test case, output one integer — the number of ordered pairs of positive integers such that when Alice adds them, she will get a result of .
Input
The input consists of multiple test cases. The first line contains an integer () — the number of test cases. The description of the test cases follows.
The only line of each test case contains an integer () — the number Alice shows Bob.
Output
For each test case, output one integer — the number of ordered pairs of positive integers such that when Alice adds them, she will get a result of .
Samples
Note
In the first test case, when Alice evaluates any of the sums , , , , , , , , or , she will get a result of . The picture below shows how Alice evaluates :
