Type: Default 1000ms 512MiB

【USTCPC2025】L. 一道数学题

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

克露丝卡尔酱不明白,在算法竞赛中怎么会出现一道数学题呢?
因为我们是中国数学物理大学
克露丝卡尔酱不是一个合格的中国数学物理大学的学生,帮帮她吧!

对所有可能的 mm 个和为 nn不同正整数 a1,a2,a_1,a_2,\cdots ama_m,求 a1a2+a2a3+a3a4++ama1a_1a_2+a_2a_3+a_3a_4+\cdots+a_ma_1 的最小值。

答案对 998244353998244353 取模

输入格式

一行,两个用空格隔开的整数 mmnn (2n,m1×1010)(2\le n,m\le 1\times10^{10})。保证 nm(m+1)2n\ge\dfrac {m(m+1)}{2}

输出格式

输出仅包含 1111 个数字,为上述最小值 998244353998244353 取模的值。

样例

输入

4 10

输出

21

USTCPC2025 线上赛

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
15
Start at
2025-3-23 19:00
End at
2025-3-30 12:00
Duration
161 hour(s)
Host
Partic.
103