题目地址


#include<cstdio>
#include<iostream>
#define ll long long
using namespace std;
int main(){
	ll n,k;
	scanf("%lld %lld",&n,&k);
	ll ans=n*k;
	int gx;
	for(int x=1;x<=n;x=gx+1){
		gx=k/x?min(k/(k/x),n):n;
		ans-=(k/x)*(x+gx)*(gx-x+1)/2;
	}
	printf("%lld\n",ans);
	return 0;
}