Given an array of positive integers of length $$$n$$$, determine how many non-empty subarrays $$$^{\text{*}}$$$ satisfy the following condition: the sum of the elements in the subarray is divisible by the largest digit $$$^{\text{†}}$$$ appearing in the subarray.
$$$^{\text{*}}$$$ An array $$$a$$$ is a non-empty subarray of array $$$b$$$ if and only if $$$a$$$ can be obtained by deleting zero or more elements from the beginning of $$$b$$$ and zero or more elements from the end of $$$b$$$, and $$$a$$$ contains at least one element.
$$$^{\text{†}}$$$ A digit refers to any of the numbers $$$0,1,2,3,4,5,6,7,8,9$$$ that compose a number. For example, the array $$$[213]$$$ contains the digits $$$1,2,3$$$, so the largest digit is $$$3$$$; the array $$$[2025,11,15]$$$ contains the digits $$$0,1,2,5$$$, so the largest digit is $$$5$$$.
Each test contains multiple test cases. The first line contains an integer $$$T(1 \le T \le 10^4)$$$, indicating the number of test cases.
For each test case:
The first line gives an integer $$$n(1\le n\le 10^5)$$$, representing the array length.
The second line contains $$$n$$$ positive integers $$$x_1, x_2, \ldots, x_n$$$ ($$$1 \le x_i \le 10^9$$$), representing the array.
It is guaranteed that the sum of all $$$n$$$ values across all test cases does not exceed $$$10^5$$$.
For each test case, output one line containing an integer representing the number of non-empty subarrays that satisfy the condition.
2 3 213 12 21 7 314 880 246 170 493 474 129
4 7
| Name |
|---|


