#C10040. Flatten and Filter Integers

    ID: 39202 Type: Default 1000ms 256MiB

Flatten and Filter Integers

Flatten and Filter Integers

Given a list of lists of integers and an integer threshold T, your task is to flatten the list of lists into a single list, filter out all integers that are less than or equal to T, and then output the remaining integers in sorted (non-decreasing) order. In mathematical terms, if you are given lists \(L_1, L_2, \dots, L_n\) and a threshold \(T\), you must produce the sorted list \(R\) defined by:

[ R = \text{sorted}({ x \mid x \in L_i,; x > T, ; \forall i }) ]

If there are no integers greater than T, output an empty line.

inputFormat

The first line contains two integers N and T, where N is the number of nested lists and T is the threshold.

Each of the next N lines starts with an integer M (the number of elements in that list), followed by M space-separated integers.

outputFormat

Output a single line containing the sorted list of integers (space-separated) that are strictly greater than T. If no such numbers exist, output an empty line.

## sample
3 4
3 1 4 5
2 3 8
1 2
5 8