Construction#229

Construction

1 second
128 megabytes
Medium (≈1350)

After completing the construction of his rural house, Aladdin has wooden planks of lengths l_1, ..., l_n left. Aladdin decides to build a deck for fishing using these planks. He believes that the longer the deck, the more fish he can catch.

Like many fishermen, Aladdin believes in certain signs. One of these is that the deck can only be constructed from full-length planks (planks can be cut but not glued). Aladdin wants to build the longest possible deck of length while ensuring that exactly planks are used.

Input

The input consists of n, m, l_i~(1 \le n \le 10000, 1 \le m, l_i \le 2 \cdot 10^9) — the number of planks available, the number of planks to be used, and the lengths of the available planks.

Output

Output — the longest possible deck length, or if it is not possible to construct the deck, output (zero).

Examples

Example 1

Loading
Loading