Directed?#12207

Directed?

1 second
256 megabytes
Very easy

You are given an object on the axis. Initially, you are at point , and you make steps on the axis. In the -th step, you change your coordinate according to the rule x := x + a_i. The current position has three cases:

During the simulation of all the object's movements, how many times will the object be undirected?

Input

The first line contains one integer (1 \le t \le 10^4) – the number of test cases.

The first line of each test case contains two integers (1 \le n \le 10^5; -100 \le x \le 100) – the number of moves and the initial position.

The second line contains space-separated integers a_1,a_2,..,a_n (-1000 \le a_1,a_2,..,a_n \le 1000) – moves along the line.

It is guaranteed that the sum of does not exceed 4 \cdot 10^5.

Output

For each test case, output a single integer, which is the number of times the object is undirected.

Examples

Example 1

Loading
Loading

Note

In the first test case, we have the following process:

  • Move : Initially, you are at point c=0, so you are undirected.

  • Move : You are at point c=0+1=1.

  • Move : You are at point c=2+1=3.

  • Move : You are at point c=3-2=1.

  • Move : You are at point c=1-1=0, so you are undirected.

Thus, the answer is .

In the second test case, we have the following process:

  • Move : You are at point c=3.

  • Move : You are at point c=3+1=4.

  • Move : You are at point c=4-3=1.

  • Move : You are at point c=1-5=-4.

  • Move : You are at point c=-4+5=1.

  • Move : You are at point c=1+1=2.

Thus, the answer is .

In the third test case, we have the following process:

  • Move : You are at point c=2.

  • Move : You are at point c=2-1=1.

  • Move : You are at point c=1-1=0, so you are undirected.

  • Move : You are at point c=0-1=-1.

  • Move : You are at point c=-1+1=0, so you are undirected.

Thus, the answer is .

In the fourth test case, we have the following process:

  • Move : You are at point .

  • Move : You are at point 3-1=2.

  • Move : You are at point 2-1=1.

  • Move : You are at point 1-1=0, so you are undirected.

Thus, the answer is .

In the fifth test case, we have the following process:

  • Move : You are at point .

  • Move : You are at point 4-3=1.

  • Move : You are at point 1-1=0, so you are undirected.

  • Move : You are at point (no move), so you are undirected.

  • Move : You are at point (no move), so you are undirected.

Thus, the answer is .

Scoring

  1. Subtask ( points) : (a_i=1).

  2. Subtask ( points) : (a_i>0;x>0)

  3. Subtask ( points) : (1 \le n \le 500)

  4. Subtask ( points) : No additional constraints.