NCD 2019 |
---|
Finished |
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$$$.
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 $$$).
For each test case output the number of groups of students such that Masaoud can steal their slices.
2 1 4 3 2 4 1 5
1 1
Name |
---|