using System;
using System.Numerics;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Collections;

namespace debug
{
    class main
    {
        static void Main(string[] args)
        {
            //問題クラスを展開
            ProgramE a = new ProgramE();
            a.main();//実行する

        }

    }
    //ABC170
    class ProgramA
    {
        public void main()
        {
            //入力
            int x = int.Parse(Console.ReadLine());


            if (x >= 30)
                Console.WriteLine("Yes");
            else
                Console.WriteLine("No");

        }
    }

    class ProgramB
    {
        public void main()
        {
            //入力
            
            string[] s = Console.ReadLine().Split(' ');
            long n = long.Parse(s[0]);
            long d = long.Parse(s[1]);

            long count = 0;
            for(int i = 0; i < n;i++)
            {
                string[] t = Console.ReadLine().Split(' ');
                long x = long.Parse(t[0]);
                long y = long.Parse(t[1]);
                if (x * x + y * y <= d * d)
                    count++;
            }

            Console.WriteLine(count);

        }
    }

    class ProgramC
    {
        public void main()
        {

            //入力
            int k = int.Parse(Console.ReadLine());

            if(k % 2 == 0)
            {
                Console.WriteLine("-1");
                return;
            }

            if (7 % k == 0)
            {
                Console.WriteLine("1");
                return;
            }


            int flag = 0;
            long num = 7;
            long count = 1;

            while(flag == 0)
            {
                count++;
                num *= 10;
                num += 7;
                num %= k;
                if (num == 0)
                    flag = 1;
                if (count >= 10000000)
                {
                    Console.WriteLine("-1");
                    return;
                }
                
            }

            Console.WriteLine(count);




        }
    }

    class ProgramD
    {
        public void main()
        {

            //入力
            long n = long.Parse(Console.ReadLine());
            string s = Console.ReadLine();

            int wc = 0;
            int rc = 0;
            for (int i = 0; i < n; i++)
            {
                if (s[i] == 'R')
                    rc++;
                else
                    wc++;
            }

            if (wc == 0)
            {
                Console.WriteLine("0");
                return;
            }

            int rw = 0;
            int ww = 0;

            for (int i = 0; i < rc; i++)
            {
                if (s[i] == 'W')
                    rw++;
            }

            for (int i = rc; i < n; i++)
            {
                if (s[i] == 'R')
                    ww++;
            }

            
            Console.WriteLine(Math.Min(rw,ww) + Math.Abs(rw - ww));
            

        }

    }

    class ProgramE
    {

        public void main()
        {
            //入力
            string[] s = Console.ReadLine().Split(' ');
            long n = long.Parse(s[0]);
            long k = long.Parse(s[1]);

            long[] a = new long[n];

            string[] t = Console.ReadLine().Split(' ');

            for(int i = 0;i < n;i++)
                a[i] = long.Parse(t[i]);

            long min = 0;
            long max = 1000000000;

            while(min + 1 != max)
            {
                long temp = (min + max) / 2;
                long cut = 0;
                for (int i = 0; i < n; i++)
                {
                    if (a[i] < temp)
                        continue;

                    if(a[i] % temp == 0)
                        cut += a[i] / temp - 1;
                    else
                        cut += a[i] / temp;
                }

                if (cut <= k)
                    max = temp;
                else
                    min = temp;

            }

            Console.WriteLine(max);

        }


    }

}






Measured memory_bytes: 44732