Count Min Ratio

아직 제출이 없습니다시간 제한4초메모리 제한1024 MB

문제

You have RR red balls, BB blue balls, and one green ball. You are going to arrange the balls in a row. The score of an arrangement is defined as follows:

  • Let l_R,l_B,r_R,r_Bl\_{\mathrm{R}},l\_{\mathrm{B}},r\_{\mathrm{R}},r\_{\mathrm{B}} be the number of red/blue balls to the left/right of the green ball, respectively. Then, the score is the maximum integer xx such that l_B×xl_Rl\_{\mathrm{B}} \times x \leq l\_{\mathrm{R}} and r_B×xr_Rr\_{\mathrm{B}} \times x \leq r\_{\mathrm{R}}.

Find the sum of scores of all possible arrangements, modulo 998244353998244353. Note that balls of the same color cannot be distinguished, thus two arrangements are considered different if and only if there is such an ii that the color of the ii-th ball in the first arrangement differs from that of the second.

입력

The first line contains integers RR (1R10181 \leq R \leq 10^{18}) and BB (1B1061 \leq B \leq 10^6).

출력

Print the answer.