#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x MM,DD; ll dp[205][2050]; void solve() { int i,j,k,l,r,x,y; string s; dp[0][0]=1; FOR(i,202) { for(y=2000;y>=0;y--) { for(x=9;x>=0;x--) (dp[i+1][y+x]+=dp[i][y])%=mo; } } cin>>M>>D; reverse(M.begin(),M.end()); reverse(D.begin(),D.end()); int tot=0; while(D.size()) { int x=D[D.size()-1]-'0'; FOR(i,x) FOR(y,2020) if(dp[D.size()-1][y]) (DD[y+tot+i] += dp[D.size()-1][y])%=mo; tot+=x; D.pop_back(); } DD[tot]++; tot=0; while(M.size()) { int x=M[M.size()-1]-'0'; FOR(i,x) FOR(y,2020) if(dp[M.size()-1][y]) (MM[y+tot+i] += dp[M.size()-1][y])%=mo; tot+=x; M.pop_back(); } MM[tot]++; ll ret=0; ITR(it,MM) if(it->first) ret += it->second*DD[it->first]%mo; cout<