#C8286. Largest Multiple Finder

    ID: 52251 Type: Default 1000ms 256MiB

Largest Multiple Finder

Largest Multiple Finder

Given an array of N integers and an integer K, the task is to find the largest number in the array that is a multiple of K. In other words, you need to find the maximum number a in the array such that $$a \mod K = 0$$. If no such number exists, the output should be -1.

inputFormat

The input is given via standard input (stdin) and consists of two lines. The first line contains two integers N and K separated by a space. The second line contains N space-separated integers, representing the elements of the array.

outputFormat

Output a single integer to standard output (stdout): the largest number in the array that is a multiple of K, or -1 if no such number exists.

## sample
5 3
1 2 3 9 6
9