#K61762. Filter Numbers Greater or Equal to Threshold
Filter Numbers Greater or Equal to Threshold
Filter Numbers Greater or Equal to Threshold
You are given a list of integers and an integer threshold T. Your task is to output a new list that contains only the elements from the input list that satisfy the condition \(a_i \ge T\) while preserving the order of appearance.
The input will be provided via standard input. The expected output is printed to standard output. If no numbers satisfy the condition, print an empty line.
Example:
Input: 6 1 2 5 6 3 8 5</p>Output: 5 6 8
inputFormat
The input consists of three parts provided via standard input in the following order:
- An integer
n
on the first line indicating the number of elements in the list. - A line containing
n
space-separated integers representing the list. Ifn
is 0, this line may be empty. - An integer
T
on the last line representing the threshold.
It is guaranteed that the values will be in valid integer format.
outputFormat
Output the filtered list in a single line, with the numbers separated by a single space. If there are no elements that meet the requirement, output an empty line.
## sample6
1 2 5 6 3 8
5
5 6 8