#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long int llint; typedef double lldo; #define mp make_pair #define mt make_tuple #define pub push_back #define puf push_front #define pob pop_back #define pof pop_front #define fir first #define sec second #define res resize #define ins insert #define era erase /* cout<bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;} template bool maxeq(T& a,U b){if(a void SO(T& ve){sort(ve.begin(),ve.end());} template void REV(T& ve){reverse(ve.begin(),ve.end());} templatellint LBI(vector&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();} templatellint UBI(vector&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();} int main(void){ cin.tie(0); ios::sync_with_stdio(false); llint P,Q,i;cin>>P>>Q; //商の区間で区切る vector>wa; //場所、それまでの合計 wa.reserve(sqrt(P)*2 +10); llint mae=mod; for(i=1;;i++){ if(P/i==mae){break;} mae=P/i; wa.pub(mp(mae+1,0)); } for(i=mae;i>=1;i--){wa.pub(mp(i,0));} REV(wa); llint gen=0; for(i=1;i>L>>R;R++; llint ans=0; int Rbas=LBI(wa,mp(R,big))-1; //cerr<<"de"<