#P7224. [RC-04] 子集积

[RC-04] 子集积

Problem Description

Given nn integers a1ana_1\sim a_n, in the multiset formed by them, how many subsets have a product of elements greater than mm? (The product of elements of the empty set is equal to 11.)

Two subsets are different if and only if the indices of the elements they contain are different.

The answer is very large, so please output its value modulo 998244353998244353.

Input Format

The first line contains two integers n,mn, m.

The next line contains nn positive integers a1ana_1\sim a_n, describing this multiset.

Output Format

Output one integer in one line, which is the answer modulo 998244353998244353.

4 4
1 1 2 3
4
20 123456
1 5 12 24 189893 233333 2 22 134 3284 28456 261 50 10 1 2 2 2 2 22
1036360

Hint

[Sample 11 Explanation]

The following subsets satisfy the requirement: {a3,a4}\{a_3,a_4\}, {a1,a3,a4}\{a_1,a_3,a_4\}, {a2,a3,a4}\{a_2,a_3,a_4\}, {a1,a2,a3,a4}\{a_1,a_2,a_3,a_4\}.

[Constraints]

For all testdata, 0n,m1060\le n,m\le 10^6, 1ai1061\le a_i\le 10^6.

The detailed constraints are shown in the table below:

Test Point ID nn mm aia_i Score per Test Point
11 =0=0 11
22 =0=0
363\sim 6 22\le 22 44
7107\sim 10 1000\le 1000
111411\sim 14 All distinct
151915\sim 19 2×105\le 2\times 10^5 55
202420\sim 24

Translated by ChatGPT 5