mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-25 19:12:02 +00:00
20 lines
358 B
C++
20 lines
358 B
C++
#include <iostream>
|
|
#include <cmath>
|
|
|
|
using std::cin;
|
|
using std::cout;
|
|
using std::endl;
|
|
|
|
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 ? std::min(k / (k / x), n) : n;
|
|
ans -= (k / x) * (x + gx) * (gx - x + 1) / 2;
|
|
}
|
|
cout << ans << endl;
|
|
return 0;
|
|
}
|