Monke Knapsack

View as PDF

Submit solution

Points: 25 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Max the monke has been sent to the store to grab some bananas. There are N types of bananas, each with a size s_i and an infinite supply. Max wants to fill his backpack with bananas. If Max's backpack can hold bananas with total size at most M, how many ways can he fill his backpack? Note that the order of the items in his backpack matters.

Input Specification

The first line of the input contains two integers N,M\ (1 \leq N \leq M \leq 2\cdot 10^5).

The second line will contain N integers s_i\ (1 \leq s_i \leq M).

Output Specification

On one line you are to print the number of ways he can fill his backpack modulo 998244353.

Subtasks

Subtask 1 (5%)

M \leq 2000

Subtask 2 (95%)

No further constraints.

Sample Input

2 5
1 2

Sample Output

8

Comments

There are no comments at the moment.