原题
#include<bits/stdc++.h> using namespace std; long long n,k,ans; int main() { scanf("%lld%lld",&n,&k); for (register long long l=1,r,t;l<=n;l=r+1) { r=(t=k/l) ? min(k/t,n) : n; ans-=t*(r-l+1)*(l+r)>>1; } printf("%lld ",ans+n*k); return 0; }