https://www.acmicpc.net/problem/1654
#include<stdio.h>
int main() {
int k,n;
scanf("%d %d",&k,&n);
int arr[k];
for(int i=0;i<k;i++){
scanf("%d",&arr[i]);
}
for(int i=0;i<k;i++){
for(int j=0;j<k-1-i;j++){
if(arr[j]>arr[j+1]){
int temp=arr[j];
arr[j]=arr[j+1];
arr[j+1]=temp;
}
}
}
long max=arr[k-1];
long min=1;
long mid=0;
while(min<=max){
long count=0;
mid=(min+max)/2;
for(int i=0;i<k;i++){
count+=arr[i]/mid;
}
if(count>=n) min=mid+1;
else if(count<n) max=mid-1;
}
printf("%d",max);
}