import sys
read = sys.stdin.read
readlines = sys.stdin.readlines

from math import ceil
def main():
    n, k = map(int, input().split())
    a = tuple(map(int, input().split()))

    def kaisu(long):
        return(sum([ceil(ae/long) - 1 for ae in a]))

    def bs_meguru(key):
        def isOK(index, key):
            if kaisu(index) <= key:
                return True
            else:
                return False
        ng = 0
        ok = max(a)
        while abs(ok - ng) > 1:
            mid = (ok + ng) // 2
            if isOK(mid, key):
                ok = mid
            else:
                ng = mid
        return ok
    print(bs_meguru(k))

if __name__ == '__main__':
    main()
 import sys sys read = sys.stdin.read read sys.stdin.read sys.stdin sys stdin read readlines = sys.stdin.readlines readlines sys.stdin.readlines sys.stdin sys stdin readlines from math import ceil def main():
    n, k = map(int, input().split())
    a = tuple(map(int, input().split()))

    def kaisu(long):
        return(sum([ceil(ae/long) - 1 for ae in a]))

    def bs_meguru(key):
        def isOK(index, key):
            if kaisu(index) <= key:
                return True
            else:
                return False
        ng = 0
        ok = max(a)
        while abs(ok - ng) > 1:
            mid = (ok + ng) // 2
            if isOK(mid, key):
                ok = mid
            else:
                ng = mid
        return ok
    print(bs_meguru(k)) main n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k a = tuple(map(int, input().split())) a tuple(map(int, input().split())) tuple map(int, input().split()) map int input().split() ().split () input split def kaisu(long):
        return(sum([ceil(ae/long) - 1 for ae in a]))

     kaisu ceil(ae/long) - 1 for ae in a for ae in a ae a for ae in a ceil(ae/long) - 1 ceil(ae/long) ceil ae/long ae long 1 return(sum([ceil(ae/long) - 1 for ae in a])) sum([ceil(ae/long) - 1 for ae in a]) sum [ceil(ae/long) - 1 for ae in a] long long def bs_meguru(key):
        def isOK(index, key):
            if kaisu(index) <= key:
                return True
            else:
                return False
        ng = 0
        ok = max(a)
        while abs(ok - ng) > 1:
            mid = (ok + ng) // 2
            if isOK(mid, key):
                ok = mid
            else:
                ng = mid
        return ok
     bs_meguru def isOK(index, key):
            if kaisu(index) <= key:
                return True
            else:
                return False
         isOK if kaisu(index) <= key:
                return True
            else:
                return False
         kaisu(index) <= key kaisu(index) kaisu index key return True True return False False index index key key ng = 0 ng 0 ok = max(a) ok max(a) max a while abs(ok - ng) > 1:
            mid = (ok + ng) // 2
            if isOK(mid, key):
                ok = mid
            else:
                ng = mid
         abs(ok - ng) > 1 abs(ok - ng) abs ok - ng ok ng 1 mid = (ok + ng) // 2 mid (ok + ng) // 2 ok + ng ok ng 2 if isOK(mid, key):
                ok = mid
            else:
                ng = mid
         isOK(mid, key) isOK mid key ok = mid ok mid ng = mid ng mid return ok ok key key print(bs_meguru(k)) print bs_meguru(k) bs_meguru k if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main read = sys.stdin.read sys.stdin.read read def main():
    n, k = map(int, input().split())
    a = tuple(map(int, input().split()))

    def kaisu(long):
        return(sum([ceil(ae/long) - 1 for ae in a]))

    def bs_meguru(key):
        def isOK(index, key):
            if kaisu(index) <= key:
                return True
            else:
                return False
        ng = 0
        ok = max(a)
        while abs(ok - ng) > 1:
            mid = (ok + ng) // 2
            if isOK(mid, key):
                ok = mid
            else:
                ng = mid
        return ok
    print(bs_meguru(k)) def main():
    n, k = map(int, input().split())
    a = tuple(map(int, input().split()))

    def kaisu(long):
        return(sum([ceil(ae/long) - 1 for ae in a]))

    def bs_meguru(key):
        def isOK(index, key):
            if kaisu(index) <= key:
                return True
            else:
                return False
        ng = 0
        ok = max(a)
        while abs(ok - ng) > 1:
            mid = (ok + ng) // 2
            if isOK(mid, key):
                ok = mid
            else:
                ng = mid
        return ok
    print(bs_meguru(k)) main readlines = sys.stdin.readlines sys.stdin.readlines readlines
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines

from math import ceil
def main():
    n, k = map(int, input().split())
    a = tuple(map(int, input().split()))

    def kaisu(long):
        return(sum([ceil(ae/long) - 1 for ae in a]))

    def bs_meguru(key):
        def isOK(index, key):
            if kaisu(index) <= key:
                return True
            else:
                return False
        ng = 0
        ok = max(a)
        while abs(ok - ng) > 1:
            mid = (ok + ng) // 2
            if isOK(mid, key):
                ok = mid
            else:
                ng = mid
        return ok
    print(bs_meguru(k))

if __name__ == '__main__':
    main()

