Given a string consisting of digits 0-9, count the number of subsequences in it divisible by n.
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. The first line of each test case contains an integer M and N where M denotes the length of the numeric string.
The second line of each test case contains the numeric string.
Output the number of subsequences dicisible by N. Since the number can be quite large print the answer modulo 109+7.
1<= T <=100
1<= M <=1000
1<= N <=1000
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.