201073: [AtCoder]ARC107 D - Number of Multisets

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

Description

Score : $600$ points

Problem Statement

You are given two positive integers $N$ and $K$. How many multisets of rational numbers satisfy all of the following conditions?

  • The multiset has exactly $N$ elements and the sum of them is equal to $K$.
  • Each element of the multiset is one of $1, \frac{1}{2}, \frac{1}{4}, \frac{1}{8}, \dots$. In other words, each element can be represented as $\frac{1}{2^i}\ (i = 0,1,\dots)$.

The answer may be large, so print it modulo $998244353$.

Constraints

  • $1 \leq K \leq N \leq 3000$
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

$N$ $K$

Output

Print the number of multisets of rational numbers that satisfy all of the given conditions modulo $998244353$.


Sample Input 1

4 2

Sample Output 1

2

The following two multisets satisfy all of the given conditions:

  • ${1, \frac{1}{2}, \frac{1}{4}, \frac{1}{4}}$
  • ${\frac{1}{2}, \frac{1}{2}, \frac{1}{2}, \frac{1}{2}}$

Sample Input 2

2525 425

Sample Output 2

687232272

Input

题意翻译

给出两个正整数$  N,K。$求有多少有理数集满足以下所有条件$:$ $1、$集合有且只有$ N $个元素$,$并且元素和为$  K。$ $2、$每个元素须可表示为 $  \frac {1}{2^{i}}$  $(i\in N) 。$ 答案可能很大$,$请将其对$ 998244353  $取$  mod  。$

加入题单

算法标签: