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

namespace contest_Csharp
{
    class PriorityQueue<T> : IEnumerable<T> where T : IComparable<T>
    {
        private List<T> heap = new List<T>();
        private int lastindex = -1;
        private void swap(int n, int m)
        {
            T wait = heap[n];
            heap[n] = heap[m];
            heap[m] = wait;
        }
        public int Count()
        {
            return lastindex + 1;
        }
        public void Enqueue(T data)
        {
            int p;
            if (lastindex + 1 < heap.Count())
            {
                heap[lastindex + 1] = data;
            }
            else
            {
                heap.Add(data);
            }
            lastindex++;
            p = lastindex;

            while (true)
            {
                if (p > 0 && heap[p].CompareTo(heap[(p - 1) / 2]) <= -1)
                {
                    swap(p, (p - 1) / 2);
                    p = (p - 1) / 2;
                }
                else
                {
                    break;
                }
            }
        }
        public T Peek()
        {
            return heap[0];
        }
        public T Dequeue()
        {
            T result = Peek();
            heap[0] = default(T);
            swap(0, lastindex);
            lastindex--;
            int p = 0;
            while (true)
            {
                int np;
                if (2 * p + 1 > lastindex)
                {
                    break;
                }
                else
                {
                    np = ((2 * p + 1 == lastindex) || heap[2 * p + 1].CompareTo(heap[2 * p + 2]) <= -1)
                        ? (2 * p + 1) : (2 * p + 2);
                }
                if (heap[p].CompareTo(heap[np]) >= 1)
                {
                    swap(p, np);
                    p = np;
                }
                else
                {
                    break;
                }
            }

            return result;
        }
        public PriorityQueue<T> Clone()
        {
            var c = new PriorityQueue<T>();
            T[] ar = null;
            heap.ToArray().CopyTo(ar, 0);
            c.heap = ar.ToList();
            c.lastindex = lastindex;
            return c;
        }
        public IEnumerator<T> GetEnumerator()
        {
            PriorityQueue<T> copy = new PriorityQueue<T>();
            T[] carray = null;
            heap.ToArray().CopyTo(carray, 0);
            copy.heap = carray.ToList();
            copy.lastindex = lastindex;
            for (int i = 0; i < lastindex + 1; i++)
            {
                yield return copy.Dequeue();
            }

        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            PriorityQueue<T> copy = new PriorityQueue<T>();
            T[] carray = null;
            heap.ToArray().CopyTo(carray, 0);
            copy.heap = carray.ToList();
            copy.lastindex = lastindex;
            for (int i = 0; i < lastindex + 1; i++)
            {
                yield return copy.Dequeue();
            }
        }


    }
    class Program
    {
        public static (long m,long s)[,] dp;

        static void Main(string[] args)
        {
            checked
            {
                var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
                Console.SetOut(sw);

                var vals = Console.ReadLine().Split(' ').
                    Select(x => int.Parse(x)).ToList();

                var N = vals[0];
                var K = vals[1];
                var A= Console.ReadLine().Split(' ').
                    Select(x => int.Parse(x)).ToList();
                var Max = A.Max();
                var Inf = 0;

                while (Max-Inf>1)
                {
                    var md = (Max+Inf+1)/ 2 ;
                    var cnt = 0;
                    foreach(var a in A)
                    {
                        cnt += (a+md-1 )/ md -1;
                    }
                    if (cnt <= K)
                    {
                        Max = md;
                    }
                    else
                    {
                        Inf = md;
                    }
                }

                Console.WriteLine(Max);

                Console.Out.Flush();
            }




        }
    }
}




Measured memory_bytes: 44748