403069: GYM100989 G Mission in Amman (B)

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

G. Mission in Amman (B)time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

There are K hours left before Agent Mahone leaves Amman! Hammouri doesn't like how things are going in the mission and he doesn't want to fail again. Some places have too many students covering them, while other places have only few students.

Whenever Hammouri commands a student to change his place, it takes the student exactly one hour to reach the new place. Hammouri waits until he is sure that the student has arrived to the new place before he issues a new command. Therefore, only one student can change his place in each hour.

Hammouri wants to command the students to change their places such that after K hours, the maximum number of students covering the same place is minimized.

Given the number of students covering each place, your task is to find the maximum number of students covering the same place after K hours, assuming that Hammouri correctly minimizes this number.

Input

The first line of input contains two integers M (2 ≤ M ≤ 105) and K (1 ≤ K ≤ 109), where M is the number of places and K is the number of hours left before Agent Mahone leaves Amman.

The second line contains M non-negative integers, each represents the number of students covering one of the places. Each place is covered by at most 109 students.

Output

Print the maximum number of students covering a place after K hours, assuming that Hammouri minimized this number as much as possible in the last K hours.

ExamplesInput
5 4
3 4 1 4 9
Output
5
Input
2 1000000000
1000000000 4
Output
500000002
Input
5 3
2 2 2 2 1
Output
2

加入题单

算法标签: