#C12651. Multiples of the Largest Even Number

    ID: 42102 Type: Default 1000ms 256MiB

Multiples of the Largest Even Number

Multiples of the Largest Even Number

You are given a list of integers. Your task is to find the largest even number in the list and then output all elements from the list that are multiples of that number. If the input list does not contain any even numbers or if the input does not follow the required format, you should output an empty result.

Note: The input is provided via standard input. You must read the first line as an integer n which indicates the number of elements. The second line contains n space-separated integers.

For example:

Input:
8
2 4 6 7 8 15 20 25

Output: 20

</p>

In the above example, the largest even number is 20 and the only element in the list that is a multiple of 20 is 20 itself.

inputFormat

The first line contains an integer n representing the number of elements in the list. The second line contains n space-separated integers. If n is 0, the list is empty.

outputFormat

Print the resulting integers (those which are multiples of the largest even number) separated by a space on a single line. If no valid even number exists or no element is a multiple of it, print an empty line.## sample

8
2 4 6 7 8 15 20 25
20

</p>