#include using namespace std; using Int = long long; Int isprime(Int x){ if(x<=1) return 0; for(Int i=2;i*i<=x;i++) if(x%i==0) return 0; return 1; } template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a>n; vector p; for(Int i=0;i dp(s,-INF),used(n+1,0); dp[0]=0; for(Int i=2;i<=min(n,R);i++){ used[i]=1; vector nx(s,-INF); for(Int j=0;j nx(s,-INF); for(Int i=b;i<=n;i+=b){ used[i]=1; for(Int j=0;j nx(s,-INF); for(Int j=0;j