二分答案
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
int a[10010];
int main(){
#ifndef ONLINE_JUDGE
freopen("a.in","r",stdin);
freopen("a.out","w",stdout);
#endif
int n,k;
while(cin>>n>>k){
long long cnt=0;
int maxl=0;
for(int i=0;i<n;i++){
//之前的输入时这样写的。。
//char s[5];
//cin>>s;
//a[i]=(s[0]-'0')*100+(s[2]-'0')*10+(s[3]-'0');
int b;
scanf("%d.%d",a+i,&b);
a[i]=a[i]*100+b;
cnt+=a[i];
maxl=max(maxl,a[i]);
}
if(cnt<k){
cout<<"0.00"<<endl;
continue;
}
int s=1,t=maxl;
int ans=1;
while(t>=s){
int mid=(s+t)/2;
long long sum=0;
for(int i=0;i<n;i++)
sum+=a[i]/mid;
if(sum>=k){
s=mid+1;
if(mid>ans) ans=mid;
}
else t=mid-1;
}
printf("%.2f\n",ans*0.01);
}
return 0;
}