#include using namespace std; typedef long long ll; typedef vector vi; typedef vector vl; typedef complex P; typedef pair pii; #define REP(i,n) for(ll i=0;i0){ ll p = ps[id-1]; if(p*x>=L){ ll fct = min(p,x); if(fct>mxmn || (fct==mxmn&&p*x>ans)){ ans = p*x; mxmn = fct; continue; } } } } while(ub*x>=L && ub>1){ ll mfct=x; if(ub<125252 && isp[ub]){ mfct = min(mfct,ub); }else{ REP(j,ps.size()){ if(ub%ps[j]==0){ mfct=min(mfct,ps[j]); break; } } } if(mfct>mxmn || (mfct==mxmn&&ub*x>ans)){ ans = ub*x; mxmn = mfct; if(mfct==x)break; } --ub; } } printf("%lld\n",ans); return 0; }