#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<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) //------------------------------------------------------- ll K,L,R; ll up[21]; ll p10[25]; ll F[100],S[100],P[100]; ll mo=1000000007; string ST[100]; ll modpow(ll a, ll n = mo-2) { ll r=1; while(n) r=r*((n%2)?a:1)%mo,a=a*a%mo,n>>=1; return r; } pair getval(int K,ll V) { if(V<=0) return {0,0}; if(V==F[K]) return {S[K],P[K]}; if(V<=F[K-1]) { return getval(K-1,V); } else { pair r = {S[K-1],P[K-1]}; V -= F[K-1]; ll i; FOR(i,min(V,(ll)ST[K].size())) { char c=ST[K][i]-'0'; if(c==0) (r.second*=10)%=mo; else { r.first += c; (r.second *= c)%=mo; } } if(V>ST[K].size()) { auto b=getval(K-1,V-ST[K].size()); r.first += b.first; (r.second *= b.second)%=mo; } return r; } } void solve() { int i,j,k,l,r,x,y; string s; p10[0]=1; for(i=1;i<=19;i++) { p10[i]=p10[i-1]*10; for(x=30;x>=0;x--) if((up[i]+(1<>K>>L>>R; if(K>60) K=60; if(R>F[K]) return _P("-1\n"); auto RR = getval(K,R); if(L>1) { auto LL = getval(K,L-1); cout<