This is a Giveaway!!

All submissions for this problem are available.
As it is New Year, let’s keep this question straight forward. You are given an array $A$ of $N$ integers $A_1, …… A_N$. A good sequence is defined as a nonempty sequence of integers such that the sum of elements in **each** and **every** of its subsequence is divisible by $M$. Can you find the total number of good subsequences of the array $A$? [**Note**: a subsequence is a sequence that can be derived from the original sequence by deleting some or no elements without changing the order of the remaining elements.] ###Input:  The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.  The first line of each test case contains two spaceseparated integers $N$, $M$.  The second line contains $N$ space separated integers $A_1, A_2, …. A_N$. ###Output: For each test case, print a single line containing a single integer denoting the total number of good subsequences. ###Constraints  $1 \leq T \leq 1000$  $1 \leq N \leq 30$  $0 \leq A_i \leq 10^9$  $1 \leq M \leq 10^6$ ###Sample Input:2 2 3 1 2 2 3 1 3###Sample Output:
0 1
Author:  kishen1912000 
Editorial  https://discuss.codechef.com/problems/GIVAWAY 
Tags  cakewalk, cnxh2020, kishen1912000, math 
Date Added:  3012020 
Time Limit:  1 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 