#include #include #include #include #include #include #include #include #define DB cerr<<"D"< void caut(T a, U b, O c){cout<<"("< void caut(T a, U b){cout<<"("< void caut(T a){cout<<"("<; const ll M = 1e9+7, mx = 1000000; void add(ll& x, ll y) {x+=y; x%=M;}; void mul(ll& x, ll y) {x*=y; x%=M;}; void chmax(ll& x, ll y) {if (xy) x=y;}; ll mod_pow(ll x, ll a) { ll an = 1; while(a > 0) { if (a&1) an = an * x % M; x = x * x % M; a >>= 1;} return an;} vector sm(700005), inv(700005); void sm_build() { sm[0]=1;for(ll i=1;i<700005;i++) sm[i]=sm[i-1]*i%M; inv[700004]=mod_pow(sm[700004],M-2);for(ll i=700003;i>=0;i--) inv[i]=inv[i+1]*(i+1)%M; } ll ncr(ll n, ll r) { if (n < r) return 1; return sm[n] * inv[n-r] % M * inv[r] % M; } ll ncr2(ll n, ll r) {return sm[n] * mod_pow(sm[n-r], M-2) % M * mod_pow(sm[r], M-2) % M;} int keta(ll a) {int res=0; while(a>0) res+=a%10, a/=10; return res;} int main() { sm_build(); string s; cin>>s; int n=s.size(); int d; cin>>d; int qu = 0, mp = 0; for(int i=0;i=10;i--) { add(dp[keta(i)],dp[i]); } /* for(int i=0;i<100;i++) { cout<