#include using namespace std; using Int = long long; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a>k>>n; vector v; for(Int i=k;i<=n;i++) if(isprime(i)) v.emplace_back(i); auto calc= [](Int x){ while(x>=10){ Int res=0; string s=to_string(x); for(char c:s) res+=c-'0'; x=res; } return x; }; Int ans=0,len=0,tmp=0; set ss; for(Int i=0,j=0;i<(Int)v.size();){ while(i<(Int)v.size()){ if(ss.count(calc(v[i]))) break; ss.emplace(calc(v[i++])); tmp++; } //cout<