


A subarray is a slice from a contiguous array (i.e., occupy consecutive positions) and inherently maintains the order of elements.
The first line of the input contains ‘T’ denoting the number of test cases.
The first line of each test case contains the three integers N, length of the array.
The second line of each test case contains N space-separated integers of the array A.
For each test case, return the number of arithmetic subarrays that can be formed.
Don't print anything it has already been taken care of. Just implement the given function
1 <= T <= 100
1 <= N <= 3000
0 <= A[i] <= 5000
Time Limit: 1 second
Here we use a simple idea that if we have an arithmetic subarray A[i...j] of difference ’d’ between two consecutive elements, then to check if subarray A[i….j+1] is also arithmetic subarray of common difference ‘d’, all we need to check is if A[j+1]-A[j] == ‘d’.
Algorithm:
Algorithm: