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

#FT0000099. Chia hết cho 3 (Divisible by 3)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Chia hết cho 3 (Divisible by 3)

Divisible by 3

Source: AtCoder

Version: Phuoc Hung OJ Extended

Problem Statement

For a positive integer xx, let σ(x)\sigma(x) denote the sum of all positive divisors of xx, including 11 and xx. For example, the positive divisors of 66 are 1,2,3,61,2,3,6, so σ(6)=1+2+3+6=12\sigma(6)=1+2+3+6=12.

A positive integer xx is called good if its positive-divisor sum is divisible by 33, that is, σ(x)≡0(mod3)\sigma(x)\equiv0\pmod3. Note that the condition applies to the sum of divisors, not necessarily to the integer xx itself.

You are given two positive integers NN and MM. Consider all ordered sequences A=(A1,A2,…,AM)A=(A_1,A_2,\ldots,A_M) of exactly MM positive integers. A sequence is valid if the product

P=A1A2⋯AMP=A_1A_2\cdots A_M

is both at most NN and a good integer. Two sequences are distinct if they differ in at least one position; therefore, their ordering matters.

Count all valid sequences modulo 998244353998244353.

Input

A single line containing two positive integers NN and MM, the upper bound on the product and the required sequence length, respectively.

Output

Print a single integer: the number of valid length-MM sequences, modulo 998244353998244353.

Subtasks

  • Subtask 1 (20 points): 1≤N≤1041\le N\le10^4; 1≤M≤1051\le M\le10^5; N,MN,M are integers.
  • Subtask 2 (30 points): 1≤N≤1061\le N\le10^6; 1≤M≤1051\le M\le10^5; N,MN,M are integers.
  • Subtask 3 (50 points): 1≤N≤10101\le N\le10^{10}; 1≤M≤1051\le M\le10^5; N,MN,M are integers.

Examples

Example 1

Input

10 1

Output

5

Explanation

Since M=1M=1, every sequence contains one integer, which is also its product. We inspect integers 11 through 1010 and compute their divisor sums. We obtain σ(2)=1+2=3\sigma(2)=1+2=3, σ(5)=1+5=6\sigma(5)=1+5=6, σ(6)=1+2+3+6=12\sigma(6)=1+2+3+6=12, σ(8)=1+2+4+8=15\sigma(8)=1+2+4+8=15, and σ(10)=1+2+5+10=18\sigma(10)=1+2+5+10=18. All five sums are divisible by 33.

No other integer in [1,10][1,10] has a divisor sum divisible by 33. Therefore the valid sequences are precisely (2)(2), (5)(5), (6)(6), (8)(8), and (10)(10), and the answer is 55.

Example 2

Input

4 2

Output

2

Explanation

Every sequence has exactly two positive elements and product at most 44. The divisor sums of possible products are σ(1)=1\sigma(1)=1, σ(2)=3\sigma(2)=3, σ(3)=4\sigma(3)=4, and σ(4)=1+2+4=7\sigma(4)=1+2+4=7. Only the product 22 is good.

There are exactly two ordered pairs of positive integers with product 22: (1,2)(1,2) and (2,1)(2,1). Since their entries occur in different positions, they are distinct sequences, so the answer is 22.