#C13002. Filter Divisible Numbers
Filter Divisible Numbers
Filter Divisible Numbers
Given a list of integers and a divisor \(n\), your task is to output all numbers from the list that are divisible by \(n\). The divisor is guaranteed to be nonzero. Read the input from stdin and write the result to stdout.
The output should list the integers that are divisible by \(n\) in the same order as they appear in the input, separated by a single space. If there are no such numbers, output an empty line.
inputFormat
The input is read from stdin and consists of three lines:
- The first line contains an integer \(m\) representing the number of elements in the list.
- The second line contains \(m\) space-separated integers. (If \(m=0\), this line will be empty.)
- The third line contains the integer \(n\) (with \(n \neq 0\)).
outputFormat
Output a single line to stdout which contains the integers from the list that are divisible by \(n\), separated by a single space. If no number is divisible, output an empty line.
## sample6
1 2 3 4 5 6
2
2 4 6
</p>