#K57802. Filter By Threshold

    ID: 30501 Type: Default 1000ms 256MiB

Filter By Threshold

Filter By Threshold

You are given a list of integers and a threshold integer \(k\). Your task is to output a list containing all the elements from the input that are greater than or equal to \(k\), while preserving the original order.

For example, if the input list is [3, 10, 5, 8, 4, 2, 7] and \(k = 5\), then the output should be [10, 5, 8, 7].

inputFormat

The input is given in two lines. The first line contains two space-separated integers (n) and (k), where (n) denotes the number of elements in the list and (k) is the threshold value. The second line contains (n) space-separated integers representing the list.

outputFormat

Output a single line with the filtered integers (those greater than or equal to (k)) separated by a single space. If no element meets the condition, output an empty line.## sample

7 5
3 10 5 8 4 2 7
10 5 8 7