PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#BS0000374. Cắt dây (Ropes)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Cắt dây (Ropes)

Ropes

Version: Phuoc Hung OJ Extended

PHOJ practice edition. Its constraints, input/output format, examples and judging rules are specified below.

Statement

Given nn ropes of lengths aia_i, cut exactly kk pieces of the same positive length. A rope may yield several pieces; unused material is discarded. Joining ropes is forbidden. Piece lengths need not be integers. Find the largest possible common length.

Input

The first line contains integers n,kn,k. Each of the next nn lines contains one integer aia_i.

Output

Print the maximum length as a real number. Absolute error must not exceed 10−610^{-6}. The output token may contain at most 128 characters; in scientific notation, the explicit exponent must be from -1000 to 1000.

Subtasks

  • Subtask 1 (20 points): 1≤n≤1041\le n\le10^4; 1≤k≤201\le k\le20; 1≤ai≤1071\le a_i\le10^7 (1≤i≤n1\le i\le n).
  • Subtask 2 (30 points): 1≤n≤1041\le n\le10^4; 1≤k≤5001\le k\le500; 1≤ai≤1071\le a_i\le10^7 (1≤i≤n1\le i\le n).
  • Subtask 3 (50 points): 1≤n≤1041\le n\le10^4; 1≤k≤100001\le k\le10000; 1≤ai≤1071\le a_i\le10^7 (1≤i≤n1\le i\le n).

Illustrative examples (not verified as original samples)

Input

4 11
802
743
457
539

Output

200.500000000

Explanation

At length 200.5200.5, the four ropes yield 4,3,2,24,3,2,2 pieces, respectively, totaling 11. Any greater length yields at most 3 pieces from the rope of length 802 and no increase from the other ropes. At most 10 pieces remain possible, proving optimality.

Input

1 3
1

Output

0.333333333

Explanation

The only rope has length 1. Three equal pieces of length 1/31/3 use its entire length. Three longer pieces would require more than 1 unit of material.

Input

2 1
7
11

Output

11.000000000

Explanation

Only one piece is needed. The longer of the two ropes has length 11, which can be used intact. Joining ropes is forbidden, so a longer piece is impossible.