题目链接:cf913E
#include<bits/stdc++.h>
using namespace std;
void solved()
{
long long ans=1;
int n; cin>>n;
while(n)
{
int t=n%10;
t+=2;//算出t后,隔板法求怎么分t
ans*=(t-1)*t/2;
n/=10;
}
cout<<ans<<'\n';
}
int main()
{
int t; cin>>t;
while(t--)
solved();
}