#K50367. Finding Divisible Numbers

    ID: 28849 Type: Default 1000ms 256MiB

Finding Divisible Numbers

Finding Divisible Numbers

Given a list of integers and an integer n, your task is to find and output all numbers from the list that are divisible by n. In other words, you should output all numbers x such that \(x \mod n = 0\). The output should be printed in a single line with each number separated by a space. If no number in the list satisfies the condition, print an empty line.

inputFormat

The input is given via stdin in 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.
  • The third line contains the integer n used for divisibility checking.

outputFormat

Output via stdout a single line containing all integers from the list that are divisible by n, separated by a single space. If no such numbers exist, print an empty line.

## sample
5
10 15 20 25 30
5
10 15 20 25 30