和杭电那一题一样,只不过G++交不能通过,C++能过
wa了好多好多好多次-----------------------------------------
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cmath>
#include<stack>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<algorithm>
using namespace std; typedef long long LL;
const int INF = (<<)-;
const int mod=;
const int maxn=;
const int Exp=1e-; double a[maxn];
int n,k; bool ok(double x){
int ans=;
for(int i=;i<n;i++){
ans+=(int) (a[i]/x );
}
return ans>=k;
} int main(){
scanf("%d %d",&n,&k);
for(int i=;i<n;i++) scanf("%lf",&a[i]); double lb=,ub= INF,mid;
for(int i=;i < ;i++){
mid=(lb + ub)/;
if(ok(mid)) lb=mid;
else ub=mid; // printf("lb=%lf\n",lb);
// printf("ub=%lf\n",ub);
// printf("mid=%lf\n",mid);
}
printf("%.2lf\n",(floor)(mid*)/); return ;
}