#include <bits/stdc++.h>
using namespace std;
bool fun(int mid,vector<int>&arr,int max_moves){
    int sum=0;
    for(int i=0;i<arr.size();i++){
        sum+=(arr[i]/mid+(arr[i]%mid!=0));
    }
   
    return sum<=max_moves;
    
}

int main()
{
    vector<int>arr={4,3,2,7};
    int max_moves=5;
    
    int l=1; //not l=0 why cause that will cause undefined behavioun in edgecase in fun (divide by 0)/.
    int h=*max_element(arr.begin(),arr.end());
    int ans=-1;
    while(l<=h){
           int mid=l+(h-l)/2;
           if(fun(mid,arr,max_moves)){
               ans=mid;
               h=mid-1;
           }
           else{
               l=mid+1;
           }

    }
    cout<<ans<<endl;
    return 0;
}