using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
namespace Atcoder_0404
{
    class Program
    {
        static void Main(string[] args)
        {
            var NK = GetInput_long();
            var n = NK[0];
            var k = NK[1];
            var A_n = GetInput_long().ToList();
            A_n.Sort();
            var a_max = A_n[A_n.Count-1];

            long successMin = a_max;

            long nowMax = a_max;
            long nowMin = 1;
            long checkNumber = (nowMax+nowMin) / 2;
            while (nowMin<=nowMax)
            {
                //失敗成功判定
                long sum = 0;
                for (int i = 0; i < A_n.Count; i++)
                {

                    long needcut = A_n[i] / checkNumber;
                    if (A_n[i] % checkNumber == 0) needcut -= 1;
                    sum += needcut;
                }

                //範囲の変更処理
                if (sum <= k)//成功　もっとちいさいものをさがす;
                {
                    if (successMin > checkNumber) successMin = checkNumber;
                    
                    nowMax = checkNumber-1;
                    //nowMin = nowMin;
                }
                else//失敗もっとおおきいものをさがす
                {
                    //nowMax = nowMax;
                    nowMin = checkNumber + 1;
                }
                checkNumber = (nowMax + nowMin) / 2;
            }

            Console.WriteLine(successMin);
        }

        #region input


        static string[] GetInput_string()
        {
            var input = Console.ReadLine().Split(' ');
            return input;
        }

        static int[] GetInput_int()
        {
            var input = GetInput_string();
            var result = new int[input.Length];
            for (int i = 0; i < result.Length; i++)
            {
                result[i] = int.Parse(input[i]);
            }
            return result;
        }
        static long[] GetInput_long()
        {
            var input = GetInput_string();
            var result = new long[input.Length];
            for (int i = 0; i < result.Length; i++)
            {
                result[i] = long.Parse(input[i]);
            }
            return result;
        }
        #endregion
        #region sonota
        static void Swap_array<T>(T[] target, int a, int b)
        {
            T temp = target[a];
            target[a] = target[b];
            target[b] = temp;
        }
        static void Swap_list<T>(List<T> target, int a, int b)
        {
            T temp = target[a];
            target[a] = target[b];
            target[b] = temp;
        }
        /// <summary>
        /// 最大公約数
        /// </summary>
        public static int GCD(int a, int b)
        {

            /* 自然数 a > b を確認・入替 */
            if (a < b)
            {
                int tmp = a;
                a = b;
                b = tmp;
            }

            /* ユークリッドの互除法 */
            int r = a % b;
            while (r != 0)
            {
                a = b;
                b = r;
                r = a % b;
            }
            return b;
        }

        /// <summary>
        /// 最小公倍数
        /// </summary>
        public static int LCM(int a, int b)
        {
            int x = a * b;
            b = GCD(a, b);
            return x / b;

        }
        #endregion
        
    }
}

Measured memory_bytes: 47096