13483 - Beautiful subsequence   

Description

Given a sequence A = a1, a2, ..., aN and a number K.

A continuous subsequence A[L ... R] = aL, ..., aR of  A is called beautiful if the sum of A[L ... R] is K.

For example, if A = 3, 1, 2, 2, 4 and K = 6.

Then

  • A[1, 3] = 3, 1, 2 is beautiful.
  • A[1, 4] = 3, 1, 2, 2 is not beautiful because 3 + 1 + 2 + 2 is not 6.
  • A[4, 5] = 2, 4 is beautiful.

 

Please find the number of beautiful continuous subsequence of A.

 

Input

The first line of the input contains a number T — the number of test cases.

The first line of each test case contains two numbers N K — the length of A and the number K described in the statement.

The second line of each test case contains N numbers — a1a2, ..., aN.

 

For each test,

  1. T ≤ 10, N ≤ 103, |ai| ≤ 109, |K| ≤ 109.
  2. T ≤ 10, N ≤ 103, |ai| ≤ 109, |K| ≤ 109.
  3. T ≤ 10, N ≤ 103, |ai| ≤ 109, |K| ≤ 109.
  4. T ≤ 10, N ≤ 105, |ai| ≤ 109, |K| ≤ 109.
  5. T ≤ 10, N ≤ 105, |ai| ≤ 109, |K| ≤ 109.
  6. T ≤ 10, N ≤ 105, |ai| ≤ 109, |K| ≤ 109.

 

Output

For each test case, print the number of beautiful continuous subsequence.

 

Sample Input  Download

Sample Output  Download

Tags




Discuss