#!/usr/bin/env python3
import collections as cl
import sys
import math


def II():
    return int(sys.stdin.readline())


def MI():
    return map(int, sys.stdin.readline().split())


def LI():
    return list(map(int, sys.stdin.readline().split()))


class Logs():
    def __init__(self, K, logs):
        self.K = K
        self.logs = logs

    def canCutUnderX(self, X):
        times = 0
        for log in self.logs:
            time = math.floor(log/X)
            if log % X == 0:
                time -= 1
            times += time
            if times > self.K:
                return False

        return True

    def solve(self):
        ans = self.nibutan(0, max(self.logs))
        return ans

    def nibutan(self, l, r):
        if l + 1 == r:
            return r
        c = (l + r) // 2

        if self.canCutUnderX(c):
            return self.nibutan(l, c)
        else:
            return self.nibutan(c, r)


def main():
    _, K = MI()
    logs = LI()

    solver = Logs(K, logs)
    print(solver.solve())


main() import collections as cl collections import sys sys import math math def II():
    return int(sys.stdin.readline()) II return int(sys.stdin.readline()) int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline def MI():
    return map(int, sys.stdin.readline().split()) MI return map(int, sys.stdin.readline().split()) map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split def LI():
    return list(map(int, sys.stdin.readline().split())) LI return list(map(int, sys.stdin.readline().split())) list(map(int, sys.stdin.readline().split())) list map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split class Logs():
    def __init__(self, K, logs):
        self.K = K
        self.logs = logs

    def canCutUnderX(self, X):
        times = 0
        for log in self.logs:
            time = math.floor(log/X)
            if log % X == 0:
                time -= 1
            times += time
            if times > self.K:
                return False

        return True

    def solve(self):
        ans = self.nibutan(0, max(self.logs))
        return ans

    def nibutan(self, l, r):
        if l + 1 == r:
            return r
        c = (l + r) // 2

        if self.canCutUnderX(c):
            return self.nibutan(l, c)
        else:
            return self.nibutan(c, r) Logs def __init__(self, K, logs):
        self.K = K
        self.logs = logs

     __init__ self.K = K self.K self K K self.logs = logs self.logs self logs logs self self K K logs logs def canCutUnderX(self, X):
        times = 0
        for log in self.logs:
            time = math.floor(log/X)
            if log % X == 0:
                time -= 1
            times += time
            if times > self.K:
                return False

        return True

     canCutUnderX times = 0 times 0 for log in self.logs:
            time = math.floor(log/X)
            if log % X == 0:
                time -= 1
            times += time
            if times > self.K:
                return False

         log self.logs self logs time = math.floor(log/X) time math.floor(log/X) math.floor math floor log/X log X if log % X == 0:
                time -= 1
             log % X == 0 log % X log X 0 time -= 1 time 1 times += time times time if times > self.K:
                return False

         times > self.K times self.K self K return False False return True True self self X X def solve(self):
        ans = self.nibutan(0, max(self.logs))
        return ans

     solve ans = self.nibutan(0, max(self.logs)) ans self.nibutan(0, max(self.logs)) self.nibutan self nibutan 0 max(self.logs) max self.logs self logs return ans ans self self def nibutan(self, l, r):
        if l + 1 == r:
            return r
        c = (l + r) // 2

        if self.canCutUnderX(c):
            return self.nibutan(l, c)
        else:
            return self.nibutan(c, r) nibutan if l + 1 == r:
            return r
         l + 1 == r l + 1 l 1 r return r r c = (l + r) // 2 c (l + r) // 2 l + r l r 2 if self.canCutUnderX(c):
            return self.nibutan(l, c)
        else:
            return self.nibutan(c, r) self.canCutUnderX(c) self.canCutUnderX self canCutUnderX c return self.nibutan(l, c) self.nibutan(l, c) self.nibutan self nibutan l c return self.nibutan(c, r) self.nibutan(c, r) self.nibutan self nibutan c r self self l l r r def main():
    _, K = MI()
    logs = LI()

    solver = Logs(K, logs)
    print(solver.solve()) main _, K = MI() _ MI() MI K logs = LI() logs LI() LI solver = Logs(K, logs) solver Logs(K, logs) Logs K logs print(solver.solve()) print solver.solve() solver.solve solver solve main() main def MI():
    return map(int, sys.stdin.readline().split()) def MI():
    return map(int, sys.stdin.readline().split()) MI def main():
    _, K = MI()
    logs = LI()

    solver = Logs(K, logs)
    print(solver.solve()) def main():
    _, K = MI()
    logs = LI()

    solver = Logs(K, logs)
    print(solver.solve()) main def II():
    return int(sys.stdin.readline()) def II():
    return int(sys.stdin.readline()) II def LI():
    return list(map(int, sys.stdin.readline().split())) def LI():
    return list(map(int, sys.stdin.readline().split())) LI class Logs():
    def __init__(self, K, logs):
        self.K = K
        self.logs = logs

    def canCutUnderX(self, X):
        times = 0
        for log in self.logs:
            time = math.floor(log/X)
            if log % X == 0:
                time -= 1
            times += time
            if times > self.K:
                return False

        return True

    def solve(self):
        ans = self.nibutan(0, max(self.logs))
        return ans

    def nibutan(self, l, r):
        if l + 1 == r:
            return r
        c = (l + r) // 2

        if self.canCutUnderX(c):
            return self.nibutan(l, c)
        else:
            return self.nibutan(c, r) class Logs():
    def __init__(self, K, logs):
        self.K = K
        self.logs = logs

    def canCutUnderX(self, X):
        times = 0
        for log in self.logs:
            time = math.floor(log/X)
            if log % X == 0:
                time -= 1
            times += time
            if times > self.K:
                return False

        return True

    def solve(self):
        ans = self.nibutan(0, max(self.logs))
        return ans

    def nibutan(self, l, r):
        if l + 1 == r:
            return r
        c = (l + r) // 2

        if self.canCutUnderX(c):
            return self.nibutan(l, c)
        else:
            return self.nibutan(c, r) Logs
#!/usr/bin/env python3
import collections as cl
import sys
import math


def II():
    return int(sys.stdin.readline())


def MI():
    return map(int, sys.stdin.readline().split())


def LI():
    return list(map(int, sys.stdin.readline().split()))


class Logs():
    def __init__(self, K, logs):
        self.K = K
        self.logs = logs

    def canCutUnderX(self, X):
        times = 0
        for log in self.logs:
            time = math.floor(log/X)
            if log % X == 0:
                time -= 1
            times += time
            if times > self.K:
                return False

        return True

    def solve(self):
        ans = self.nibutan(0, max(self.logs))
        return ans

    def nibutan(self, l, r):
        if l + 1 == r:
            return r
        c = (l + r) // 2

        if self.canCutUnderX(c):
            return self.nibutan(l, c)
        else:
            return self.nibutan(c, r)


def main():
    _, K = MI()
    logs = LI()

    solver = Logs(K, logs)
    print(solver.solve())


main()
