题目链接
#pragma GCC optimize(2)
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main ()
{
int n,k; scanf("%d%d",&n,&k);
ll res=1LL*n*k;
for(ll l=1,r;l<=n;l=r+1){
int x=k/l;
if(!x) r=0;
else r=min(n,k/x);
res-=1LL*(l+r)/2*(x)*(r-l+1);
}
printf("%lld\n",res);
}