#include using namespace std; #include using namespace atcoder; using ll = long long; int l,r; vector primes(long long n){ vector res; vector is(n); for(int i = 2;i9){ ll y = 0; while(x){ y+= x%10; x/=10; } x= y; } return x; } void solve(){ auto v = primes(r+1); vector fv; for(auto &i:v)fv.push_back(f(i)); ll mxlen = 1,mxnum = 0; ll cur = fv[0]; //for(int i = 0;i st; for(int j = i;j=mxlen){ mxlen = st.size(); cur = v[i]; //cout<<':'<=mxlen){ mxlen = st.size(); cur = v[i]; st.clear(); } } } //cout<> l >> r; solve(); }