#!/usr/bin/env python3\
#@EXPECTED_RESULTS@: TIME_LIMIT_EXCEEDED, WRONG_ANSWER

#TODO: Perhaps this shouldn't yield a TLE?
# WA: Only tries integer frame rates.
import math
n, m = [int(i) for i in input().split()]
xs = [int(i) for i in input().split()]

ts = []
for f in range(1, m + 1):
    t = 0
    for x in xs:
        t += math.ceil((f * x) / 1000)
    ts.append(t / f)
print(min(ts))
