#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; const int inf=1<<30; const ll INF=1LL<<62; typedef pair P; typedef pair PP; const ll MOD=998244353; const int dy[]={0,1,0,-1}; const int dx[]={1,0,-1,0}; ll calc(ll n){ //Σk=1~N [N/k] ll res=0; // vector val; // for(ll v=1;v*v<=n;v++){ // if(n%v==0){ // val.push_back(v); // if(v*v!=n) val.push_back(n/v); // } // } // sort(val.begin(),val.end()); ll sqn = sqrt(n); ll right=n; for(ll t=1;t<=sqn;t++){ ll left = n/(t+1); //k=(left,right]のとき n/k=t res+=t*(right-left); right=left; } for(ll t=1;t<=right;t++){ res+=n/t; } return res; } ll calc_slow(ll n){ ll res=0; for(ll i=1;i<=n;i++){ res+=n/i; } return res; } ll solve(){ ll A,B; cin>>A>>B; ll res=0; res+=-(B+calc(B-A-1)) - calc(A) + calc(B); res+=B; return res; } int main(){ int T; cin>>T; // for(int i=100;i<=130;i++){ // cout<<"calc("<