問題一覧 > 通常問題

No.67 A Common Stick-Cutting Problem (1)

レベル : / AI推定難易度 : 850 / 実行時間制限 : 1ケース 5.000秒 / メモリ制限 : 512 MB / 小数誤差許容問題 絶対誤差または相対誤差が $10^{-9}$ 以下。ただし、ジャッジ側の都合で500桁未満にしてください
タグ : (AC するまで非表示) / 解いたユーザー数 338
作問者 : LayCurse
お気に入りにしたユーザー ProblemId : 145 / 自分の提出
問題文最終更新日: 2026-06-25 02:59:59
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 53 (順位表) の他の問題:

Problem Statement

Yuki has \(N\) sticks, and the length of the \(i\)-th stick is \(L_i\).
The sticks can be cut freely (in the direction that divides their length), but they cannot be joined together.
Yuki wants to make \(K\) sticks of the same length.
Write a program that finds the maximum possible length of the \(K\) sticks that can be made.

Input

\(N\)
\(L_1\ L_2\ \cdots\ L_N\)
\(K\)

All inputs are given as integers.
\(1 \leq N \leq 200000 = 2 \times 10^5\)
\(1 \leq L_i \leq 1000000000 = 10^9\)
\(1 \leq K \leq 10000000000 = 10^{10}\)

Output

Output the maximum possible length on \(1\) line.
The answer is considered correct if the absolute error or the relative error is at most $10^{-9}$.
Print a newline at the end.

Sample

Sample 1
Input
2
10 20
3
Output
10.00

By cutting the stick of length \(20\) exactly into \(2\) equal parts, you get \(3\) sticks of length \(10\).

Sample 2
Input
2
10 20
4
Output
6.666666666666667

By cutting the stick of length \(20\) into \(3\) equal parts, and cutting the stick of length \(10\) so that only a length of \(20/3\) remains and discarding the rest, you get \(4\) sticks of length \(20/3\).

Sample 3
Input
5
99 88 77 66 55
1
Output
99
Sample 4
Input
5
99 88 77 66 55
10
Output
33
Sample 5
Input
5
99 88 77 66 55
100000
Output
0.003849923001540

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。