ll N,L,x,p[2d7],j; { rd(N,L); rep(i,2,3d3){ if(!p[i]){ for(j=i;j<1d7;){ p[j+=i]=1; } } } rep(i,2,L/~-N+1){ if(!p[i]){ x-=~L+i*~-N; } } wt(x); }