PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000239. Đếm tập ổn định khi đổi thứ tự phép chia dư (Modular Stability)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Đếm tập ổn định khi đổi thứ tự phép chia dư (Modular Stability)

Đếm tập ổn định khi đổi thứ tự phép chia dư (Modular Stability)

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Count strictly increasing arrays of length kk with elements from 1..n1..n such that, for any nonnegative integer xx, applying successive modulo operations with the array elements gives the same result in every order. Print the count modulo 998244353998244353.

Input

One line with n,kn,k.

Output

Print the number of stable arrays modulo 998244353998244353.

Subtasks

  • Subtask 1 (20 points): 1≤n,k≤201\le n,k\le20.
  • Subtask 2 (30 points): 1≤n,k≤30001\le n,k\le3000.
  • Subtask 3 (50 points): 1≤n,k≤5⋅1051\le n,k\le5\cdot10^5.

Examples

Example 1

Input

7 3

Output

16

Explanation

There are (62)=15\binom62=15 valid arrays starting with 1 and one further array (2,4,6)(2,4,6).

Example 2

Input

3 7

Output

0

Explanation

It is impossible to select seven distinct values between 1 and 3.