405935: GYM102163 K Masaoud LOVES PIZZAS

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

K. Masaoud LOVES PIZZAStime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Today the dinner in NCD is Pizza. Because the dorm's restaurant is generous, each student will get a number of pizza slices.

Masaoud is no longer a student in NCD, but he is hungry, so he will steal some slices from the students of NCD. But he is on a regime because he wants to become slim. So he wants to eat less than $$$X$$$ slices of pizza.

There are $$$N$$$ students in the restaurant standing in a line. Each student $$$i$$$ has a plate that has $$$A_i$$$ slices of pizza in it. Masaoud will choose a group of students standing directly next to each other and steal all their pizzas.

How many ways can Masaoud choose a group, so that their total number of pizza slices are less than $$$X$$$.

Input

in the first line $$$T$$$, number of test cases.

For each test case, the first line contains $$$N$$$, $$$X$$$ ($$$ 1 \le N \le 10^5 $$$,$$$ 1 \le X \le 10^9 $$$) the number of students and the number given in the problem statement.

the second line contains $$$N$$$ separated integers the number of pizza slices each student has ($$$ 1 \le A_i \le 10^9 $$$).

Output

For each test case output the number of groups of students such that Masaoud can steal their slices.

ExampleInput
2
1 4
3
2 4
1 5
Output
1
1

Source/Category

加入题单

算法标签: