Question
Lucky Train Compartments
A train conductor marks each compartment with a passenger mood score. A group of consecutive compartments is called lucky if the total mood score is divisible by
The twist: scores may be negative, so remainder handling must be careful.
Input
The first line contains KaTeX can only parse string typed expression. For each test case, the first line contains KaTeX can only parse string typed expression and KaTeX can only parse string typed expression. The second line contains KaTeX can only parse string typed expression integers.
Output
For each test case, print the number of lucky subarrays. Print the output of each test-case in different lines.
Example
Example 1:
Input
Example 2:
Input
Input
1
5 5
4 5 0 -2 -3Output6Example 2:
Input
1
4 3
3 1 2 6Output6