#include #include #include using namespace std; int countCuttedSticks(vector sticks, double cutLength) { int count = 0; for (int stick: sticks) { count += (int)((double) stick / cutLength); } return count; } int main(void){ // Your code here! int N; cin >> N; vector sticks(N); for (int i=0; i < N; i++) { cin>>sticks[i]; } long long K; cin>>K; double high, low, ans; high = *max_element(sticks.begin(), sticks.end()); low = 0.0; if (countCuttedSticks(sticks, high) == K) cout << high << endl; else { while(high - low >= 0.0000000002) { ans = (high + low) / 2; if (countCuttedSticks(sticks, ans) >= K) low = ans; else high = ans; } cout << ans << endl; } }