#K51692. Inventory Restock Checker

    ID: 29144 Type: Default 1000ms 256MiB

Inventory Restock Checker

Inventory Restock Checker

You are required to implement a simple inventory management system for a store to determine which products need restocking. A product needs restocking if its available quantity is strictly less than the given threshold. In mathematical terms, for a product with quantity \(q\) and threshold \(T\), restock is needed if \(q < T\).

Your program must read from standard input and output the result for each test case on standard output.

inputFormat

The first line of the input contains an integer \(T\) representing the number of test cases. Each test case begins with an integer \(N\) — the number of products. The next \(N\) lines each contain a product name (a string without spaces) and its quantity (an integer), separated by a space. The line following the product entries contains an integer \(T_h\) which is the restocking threshold.

outputFormat

For each test case, output a single integer on a new line representing the number of products that need restocking (i.e. those products whose quantity is less than the threshold).

## sample
5
3
APPLE 50
BANANA 30
PEAR 75
40
4
MILK 10
BREAD 20
EGGS 15
CHEESE 25
20
2
PENCIL 100
PEN 1000
50
3
JUICE 5
WATER 1
SODA 10
20
3
PAPER 200
INK 100
STAPLER 10
50
1

2 0 3 1

</p>