Given a sequence of integers a[1]
, a[2]
, ..., a[n]
and an integer m.
Lets define a good sequence of integers as a non-empty sequence such that the sum of the elements in each of its non-empty subsequences is divisible by m.
Find the number of good subsequences of the sequence a.
The first line contains the number of test cases t. The first line of each test case contains two space-separated integers n (1 ≤ n ≤ 30) and m (1 ≤ m ≤ 1000). The second line contains n integers a[1]
, a[2]
, ..., a[n]
(1 ≤ a[i]
≤ 1000).
For each test case, print a single line containing one integer - the number of good subsequences.