Construction
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
After finishing his chalet construction, Stepan still has wooden boards, with lengths . He decided to build a fishing deck on a lake using these boards. Stepan believes that the longer deck is, the more fish he will catch!
Moreover, Stepan, as all fishermen, is very superstitious and trusts all omens. One of it — the deck can be build using whole boards only (boards can be cut but not joined). Now Stepan is interested what maximum integer deck length can be obtained, if needs to use boards.
Input
Contains integers — number of available boards, number of boards to be used to build the deck and the lengths of available boards.
Output
Print one integer — the maximum possible length of the deck or (zero).
Examples
Input #1
Answer #1
Submissions 5K
Acceptance rate 31%