#include #include int main() { using namespace std; cin.tie(nullptr)->sync_with_stdio(false); int n, m; cin >> n >> m; using Mint = atcoder::modint998244353; Mint ans; for (int d = 1; d <= min(m, int(1e5)); ++d) { Mint q = n / d; ans += d * q * (q + 3) / 2; } for (int d = int(1e5) + 1; d <= m;) { int q = n / d; int nd = min(n / q, m) + 1; ans += Mint(q) * (q + 3) / 2 * (d + nd - 1) * (nd - d) / 2; d = nd; } cout << ans.val() << '\n'; }