##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
| # | Title | Points | Solved | Admin | |
|---|---|---|---|---|---|
You are given an array of positive integers.
A contiguous subarray () is called valid if for every index (), there exists at least one index (, ) such that .
Find the total number of valid contiguous subarrays of the array .
The first line contains a single integer () - the number of test cases.
The first line of each test case contains a single integer () - the length of the array.
The second line of each test case contains integers () - the elements of the array.
It is guaranteed that the sum of over all test cases does not exceed .
For each test case, output a single integer — the total number of valid contiguous subarrays.
The valid subarrays are:
Subarray : because .
Subarray : because .
Subarray : because pairs with , and pairs with .
All elements are even, meaning any two elements share a common divisor of . Therefore, any subarray of length is valid. There are exactly such subarrays.