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

#GD0000235. Phân chia thùng phiếu (Distributing Ballot Boxes)

HỌC THEO LỘ TRÌNH

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

2 lộ trình

Phân chia thùng phiếu (Distributing Ballot Boxes)

Distributing Ballot Boxes

Source: UVa

Version: Phuoc Hung OJ Extended

Problem Statement

There are nn cities with populations aia_i and BB ballot boxes. Each city must receive at least one box. Boxes are used only by voters of their assigned city, and a city's voters can be divided as evenly as possible among its boxes.

Distribute the BB boxes to minimize the maximum number of voters assigned to any single box.

Input

  • The first line contains n,Bn,B.
  • Each of the next nn lines contains one integer aia_i, the population of city ii.

Output

Print the minimum possible maximum number of voters assigned to a box.

Subtasks

  • Subtask 1 (20 points): 1≤n≤201\le n\le 20; n≤B≤2⋅106n\le B\le 2\cdot 10^6; 1≤ai≤5⋅1061\le a_i\le 5\cdot 10^6.
  • Subtask 2 (30 points): 1≤n≤20001\le n\le 2000; n≤B≤2⋅106n\le B\le 2\cdot 10^6; 1≤ai≤5⋅1061\le a_i\le 5\cdot 10^6.
  • Subtask 3 (50 points): 1≤n≤5000001\le n\le 500000; n≤B≤2⋅106n\le B\le 2\cdot 10^6; 1≤ai≤5⋅1061\le a_i\le 5\cdot 10^6.

Examples

Input

2 7
200000
500000

Output

100000

Explanation

Assign 22 boxes to city 11 and 55 to city 22. Each city has a per-box load becomes 100000100000. A smaller limit would require at least 3+6=93+6=9 boxes, exceeding the available 77. Hence the answer is 100000100000.