{"problem":{"name":"K. Masaoud LOVES PIZZAS","description":{"content":"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 ","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10216K"},"statements":[{"statement_type":"Markdown","content":"Today the dinner in NCD is Pizza. Because the dorm's restaurant is generous, each student will get a number of pizza slices.\n\nMasaoud 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.\n\nThere 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.\n\nHow many ways can Masaoud choose a group, so that their total number of pizza slices are less than $X$.\n\nin the first line $T$, number of test cases.\n\nFor each test case, the first line contains $N$, $X$ ($1 <= N <= 10^5$,$1 <= X <= 10^9$) the number of students and the number given in the problem statement.\n\nthe second line contains $N$ separated integers the number of pizza slices each student has ($1 <= A_i <= 10^9$).\n\nFor each test case output the number of groups of students such that Masaoud can steal their slices.\n\n## Input\n\nin the first line $T$, number of test cases.For each test case, the first line contains $N$, $X$ ($1 <= N <= 10^5$,$1 <= X <= 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 <= A_i <= 10^9$).\n\n## Output\n\nFor each test case output the number of groups of students such that Masaoud can steal their slices.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ T \\in \\mathbb{Z} $ be the number of test cases.  \nFor each test case:  \n- Let $ N \\in \\mathbb{Z} $ be the number of students.  \n- Let $ X \\in \\mathbb{Z} $ be the maximum number of slices Masaoud can eat.  \n- Let $ A = (A_1, A_2, \\dots, A_N) $ be a sequence of positive integers representing the pizza slices per student.\n\n**Constraints**  \n1. $ 1 \\le T \\le \\text{unspecified} $  \n2. For each test case:  \n   - $ 1 \\le N \\le 10^5 $  \n   - $ 1 \\le X \\le 10^9 $  \n   - $ 1 \\le A_i \\le 10^9 $ for all $ i \\in \\{1, \\dots, N\\} $\n\n**Objective**  \nCount the number of contiguous subarrays $ A[i:j] = (A_i, A_{i+1}, \\dots, A_j) $ with $ 1 \\le i \\le j \\le N $ such that:  \n$$\n\\sum_{k=i}^{j} A_k < X\n$$","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10216K","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}