Byunggyu claims that .
Byunggyu multiplies a single-digit positive integer and a positive integer as follows: multiply each decimal digit of by , then add all these products.
For example, multiplying and gives .
Given and , find the result of multiplication using Byunggyu's method.
The input is given in the following format:
For each test case, print the result of multiplication using Byunggyu's method on a separate line.
In the first case, .
In the second case, .
is the number of test cases. Each case is given in the following format:
In the third case, .