#C1605. Count Shelves Exceeding Threshold

    ID: 44829 Type: Default 1000ms 256MiB

Count Shelves Exceeding Threshold

Count Shelves Exceeding Threshold

Given \( m \) shelves and a threshold \( t \), each shelf contains a list of product quantities. Your task is to count how many shelves have at least one product whose quantity is greater than \( t \).

Example:

  • Shelf 1: 5 10 15
  • Shelf 2: 2 3 1
  • Shelf 3: 7 8 9

If \( t = 6 \), then Shelf 1 and Shelf 3 satisfy the condition. Thus, the answer is 2.

inputFormat

The first line contains two integers, ( m ) (the number of shelves) and ( t ) (the threshold). The next ( m ) lines each contain a sequence of space-separated integers representing the product quantities on that shelf.

outputFormat

Output a single integer, which is the number of shelves that contain at least one product quantity greater than ( t ).## sample

3 6
5 10 15
2 3 1
7 8 9
2