P2261 [CQOI2007]余数求和
include
include
include
include
include
include
include
include
define INF 525525
include
using namespace std;
long long n,k,ans;
int main()
{
cin >> n >> k;
ans=n*k;
for (int x=1,gx;x<=n;x=gx+1){
gx= k/x ? min(k/(k/x),n) : n;
ans-=(k/x) * (x+gx) * (gx-x+1) / 2;
}
printf("%ld\n",ans);
return 0;
}