#K43667. Counting Customers Exceeding Threshold

    ID: 27361 Type: Default 1000ms 256MiB

Counting Customers Exceeding Threshold

Counting Customers Exceeding Threshold

In this problem, you are given several test cases. For each test case, you are provided with the number of customers and a spending threshold \(K\). For each customer, a list of integers is given, each representing the price of an item purchased by the customer. Your task is to count how many customers have a total spending that exceeds the threshold \(K\).

The total spending of a customer is computed as:

[ \text{Total Spending} = \sum_{i=1}^{m} p_i ]

where \(m\) is the number of items purchased and \(p_i\) are the individual prices. A customer is considered to have exceeded the threshold if

[ \sum_{i=1}^{m} p_i > K. ]

For each test case, output the count of customers that satisfy the condition.

inputFormat

The input is read from standard input and has the following format:

T
N1 K1
customer_1_prices
customer_2_prices
... (N1 lines for the first test case)
N2 K2
customer_1_prices
customer_2_prices
... (N2 lines for the second test case)
...

Here, \(T\) is the number of test cases. For each test case, the first line contains two integers \(N\) (the number of customers) and \(K\) (the threshold). Each of the next \(N\) lines contains space-separated integers representing the prices of items purchased by one customer.

outputFormat

For each test case, print a single integer on a new line which represents the count of customers whose total spending exceeds the threshold \(K\).

## sample
2
3 500
100 200 250
400 150
100 100 100 200
2 1000
1000
900 200 100
2

1

</p>