|
||||||||||
The classic problemTime Limit: 8000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 93 Accepted Submission(s): 12 Problem Description there are $N$ items,which has values from 0 to $N-1$,find a subset of the items(you can choose nothing),you need to make the sum of the subset $S\equiv 0(mod~M)$ what's more,we make the rule that $K$ values $(a_1,a_2..a_K)$cannot be chosen. please output the number of ways module 998244353 Input the first line contains a number $T$,means the number of the test cases. next,for each test case,the first line contains three numbers,$N,M,K$. next line contains $K$ distinct numbers,$a_1,a_2..a_K$,means the numbers cannot be chosen. $T\le 200,N\le 10^9,m\le 2048,K\le 4000$,$M$ is the Power of 2. Only for 4 test cases there are $m>200$. Output $T$ lines,for each test case,output the answer. Sample Input
Sample Output
Source | ||||||||||
|