201162: [AtCoder]ARC116 C - Multiple Sequences

Memory Limit:1024 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score : $500$ points

Problem Statement

Given are integers $N$ and $M$. How many sequences $A$ of $N$ integers satisfy the following conditions?

  • $1 \leq A_i \leq M \left(i = 1, 2, \ldots, N\right)$
  • $A_{i+1}$ is a multiple of $A_i$. $\left(i = 1, 2, \ldots, N - 1\right)$

Since the answer can be enormous, report it modulo $998244353$.

Constraints

  • All values in input are integers.
  • $1 \leq N \leq 2 \times 10^5$
  • $1 \leq M \leq 2 \times 10^5$

Input

Input is given from Standard Input in the following format:

$N$ $M$

Output

Print the answer.


Sample Input 1

3 4

Sample Output 1

13

Some of the sequences $A$ satisfying the conditions follow:

  • $A = \left(1, 1, 4\right)$
  • $A = \left(3, 3, 3\right)$
  • $A = \left(1, 2, 4\right)$

Sample Input 2

20 30

Sample Output 2

71166

Sample Input 3

200000 200000

Sample Output 3

835917264

Input

题意翻译

给定整数 $N,M(1 \le N,M \le 2\times10^5)$,按如下要求构造数列 $A$。 + $1 \le A_i \le M(i=1,2,\dots,N)$ + $A_{i+1}$ 是 $A_i$ 的倍数 $(i=1,2,\dots,N-1)$ 求出满足要求的数列个数模 $998244353$ 的值。

加入题单

上一题 下一题 算法标签: