Subsequence-Numbers Divisible by 7 CodeChef Solution | CodeChef Problem Solution 2022
Kulyash has given you an array of size .
He defines the subsequence-number of a non-empty subsequence of array as the number formed by the concatenation of all the elements of the subsequence .
Find the count of non-empty subsequences of having their subsequence-numbers divisible by . Since the answer can be huge, output it modulo .
For example: Consider . A subsequence of is . The subsequence-number of this subsequence is .
Solution Click Below:- CLICK HERE
Input Format
- The first line will contain , the number of test cases. Then the test cases follow.
- The first line of each test case contains one integer , the size of the array.
- The second line of each test case contains space-separated integers — the elements of the array .
Output Format
For each test case, output in a single line the number of subsequences with subsequence-number divisible by modulo .
Constraints
- Sum of over all test cases does not exceed
No comments:
Post a Comment