#P7224. [RC-04] 子集积
[RC-04] 子集积
Problem Description
Given integers , in the multiset formed by them, how many subsets have a product of elements greater than ? (The product of elements of the empty set is equal to .)
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 .
Input Format
The first line contains two integers .
The next line contains positive integers , describing this multiset.
Output Format
Output one integer in one line, which is the answer modulo .
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 Explanation]
The following subsets satisfy the requirement: , , , .
[Constraints]
For all testdata, , .
The detailed constraints are shown in the table below:
| Test Point ID | Score per Test Point | |||
|---|---|---|---|---|
| All distinct | ||||
Translated by ChatGPT 5