290 传统题

[CF1856C] 冲向最大值 (To Become Max)

时间限制
2000ms
内存限制
256MiB
登顶 / 尝试
0/ 0
难度
4

[CF1856C] 冲向最大值 (To Become Max)

Problem Statement

You are given an integer array aa of length nn and an integer kk. At most kk times, you may pick an index ii (1≤i<n1 \le i < n) such that ai≤ai+1a_i \le a_{i+1} and set ai:=ai+1a_i := a_i + 1.

Find the maximum possible value of max⁡(a1,…,an)\max(a_1, \dots, a_n) after at most kk operations.

Input

The first line contains tt (1≤t≤10001 \le t \le 1000). Each test case has n,kn, k (2≤n≤10002 \le n \le 1000, 1≤k≤1081 \le k \le 10^8) followed by a1,…,ana_1, \dots, a_n (1≤ai≤1091 \le a_i \le 10^9). The sum of nn does not exceed 10001000.

Output

For each test case, print the maximum achievable element value.

Example

3
3 5
1 2 3
4 2
2 1 2 1
5 10
5 1 5 1 5
4
3
7

Note

  • Constraints:1≤t≤10001 \le t \le 1000,2≤n≤10002 \le n \le 1000,1≤k≤1081 \le k \le 10^8,1≤ai≤1091 \le a_i \le 10^9,∑n≤1000\sum n \le 1000。
  • Source:Codeforces 1856C · To Become Max