#include #include using namespace std; typedef long long ll; const ll mod = 10000000000; ll n, k; double l[200002]; bool check(double mid) { ll count = 0; for(int i= 0;i < n;i++) count += (int)(l[i] / mid); //何本分ありますか? //cout << " count=" << count; if (count >= k) return 1; else return 0; } int main() { cin >> n; //木の本数 for(int i=0;i> l[i]; //木のデータ cin >> k; //必要な木片の本数 double lb =0,ub = mod; //lb:最小値 ub:最大値 for(int i=0;i<100;i++) { double mid = (lb + ub) / 2.0; if (check(mid)) lb = mid; else ub = mid; // cout << " lb=" << lb << " ub=" << ub << endl; } printf("%.14f\n", ub); return 0; }