Multiple Sequences

AtCoder
IDarc116_c
Time2000ms
Memory256MB
Difficulty
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$ [samples]
Samples
Input #1
3 4
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)$
Input #2
20 30
Output #2
71166
Input #3
200000 200000
Output #3
835917264
API Response (JSON)
{
  "problem": {
    "name": "Multiple Sequences",
    "description": {
      "content": "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$.",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "arc116_c"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Given are integers $N$ and $M$. How many sequences $A$ of $N$ integers satisfy the following conditions?\n\n*   $1 \\leq A_i \\leq M \\left(i = 1, 2, \\ldots, N\\right)$\n*   $A_{i+1}$ is a multiple of $A_i$....",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments