求赞!
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,k,ans;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin>>n>>k;
ans=n*k;
for(ll l=1,r; l<=n; l=r+1) {
if(k/l==0) r=n;
else r=min(n,k/(k/l));
ans-=k/l*(l+r)*(r-l+1)/2;
}
cout<<ans;
return 0;
}