Link has a sequence of length $$$n$$$ consisting of positive integers $$$a$$$.
Link wants to know how many subarrays of this sequence have a sum that is a prime number. In other words, how many pairs $$$(l,r)$$$ ($$$1 \leq l \leq r \leq n$$$) satisfy $$$\sum_{i=l}^{r} a_i$$$ being a prime number.
Each test file contains multiple test cases. The first line contains the number of test cases $$$T$$$ ($$$1 \leq T \leq 10^4$$$). The description of the test cases follows.
The first line contains an integer $$$n$$$ ($$$1 \leq n \leq 10^6$$$), the length of the sequence.
The second line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \leq a_i \leq 10^6$$$, $$$\sum a_i \leq 10^6$$$), representing the elements of the sequence.
It is guaranteed that the sum of all $$$n$$$ across the test cases in a single file does not exceed $$$10^6$$$, and the sum of all $$$\sum a_i$$$ across the test cases in a single file does not exceed $$$10^6$$$.
For each test case, output a single line containing one integer — the number of subarrays whose sum is a prime number.
241 2 3 4121 1 4 5 1 4 1 9 1 9 8 10
516
In the first sample test case, the valid $$$(l,r)$$$ pairs are: