#include using namespace std; using ll = long long; #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define all(x) (x).begin(),(x).end() #define pb push_back #define fi first #define se second #define dbg(x) cout<<#x" = "<<((x))< ostream& operator<<(ostream& o, const pair &p){o<<"("< ostream& operator<<(ostream& o, const vector &v){o<<"[";for(T t:v){o<=0) return dp[d][s][f]; ll ret = 0; int l=0; if(d==0) l=1; int r=9; if(s==0) r=n[d]-'0'; // printf(" (%d,%d,%d) %d ~ %d\n", d,s,f,l,r); for(int i=l; i<=r; ++i) { if(s==0) { int nf = 0; if(i>n[N-1-d]-'0') nf=1; ret += dfs(d+1,s|(i>n; N = n.size(); mod = 1e9; cout << solve() << endl; mod += 7; cout << solve() << endl; return 0; }