#include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,n) for(int i=0;i pii; typedef vector vi; typedef vector vvi; int N,K; bool sosu[200001]; int f(int n){ if(n<10) return n; int s = 0; while(n>0){ s += n%10; n /= 10; } return f(s); } int main(){ cin >> K >> N; for(int i=2;i<=N;i++) sosu[i]=true; for(int i=2;i*i<=N;i++){ if(!sosu[i]) continue; for(int j=i*2;j<=N;j+=i){ sosu[j] = false; } } vector s; for(int i=K;i<=N;i++) if(sosu[i]) s.push_back(i); vector cnt(s.size()); for(int i=0;i use(10,false); int ans = 0; int len = 0; int l=0,r=0; for(r=0;r