#C12086. Filter Integers Greater Than a Given Number
Filter Integers Greater Than a Given Number
Filter Integers Greater Than a Given Number
Given a list of integers and a threshold integer \(n\), your task is to output a new list (preserving the original order) that contains all elements strictly greater than \(n\).
Formally, given a list \(L = [a_1, a_2, \dots, a_m]\) and an integer \(n\), you need to find all \(a_i\) such that \(a_i > n\). If no such element exists, output an empty line.
Example:
Input: 6 7 4 12 1 9 3 5 Output: 7 12 9
inputFormat
The input is provided via standard input (stdin) and consists of three parts:
- The first line contains an integer \(m\), representing the number of elements in the list.
- The second line contains \(m\) integers separated by spaces.
- The third line contains an integer \(n\), the threshold.
outputFormat
Print on a single line all integers from the list that are strictly greater than \(n\), separated by a single space. If no such integer exists, print an empty line.
## sample0
5