一.题目链接.
HYSBZ-1257
二.题目大意:
三.分析:
四.代码实现:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
int n, k;
scanf("%d %d", &n, &k);
ll ans = 1ll * n * k;
for(int l = 1, r; l <= n; l = r + 1)
{
if(k / l == 0) break;
r = min(k / (k / l), n);
ans -= 1ll * (k / l) * (l + r) * (r - l + 1) / 2;
}
printf("%lld\n", ans);
return 0;
}