运行结果是113
#include<iostream>
using namespace std;
const int N=100005;
int n, k, ans, a[N], sum=0;
int main(){
cin>>n>>k;
for(int i=0; i<n; i++) {
cin>>a[i];
sum+=a[i];
}
//cout<<" "<<sum/k<<endl;
int l=1, r=sum/k;
if(sum<k){
cout<<'0'<<endl;
return 0;
}
while(l<r){
int mid=l+(r-l)/2, tmp=0;
for(int i=0; i<n; i++) tmp+=a[i]/mid;
if(tmp>=k){
ans=mid;
l=mid+1;
}
else r=mid-1;
}
cout<<ans;
return 0;
}