Problem: // We decided to drop the legend about the power sockets but feel free to come up with your own :^)

Define a chain: 

  * a chain of length 1 is a single vertex; 
  * a chain of length x is a chain of length x-1 with a new vertex connected to the end of it with a single edge. 



You are given n chains of lengths l_1, l_2, ..., l_n. You plan to build a tree using some of them.

  * Each vertex of the tree is either white or black. 
  * The tree initially only has a white root vertex. 
  * All chains initially consist only of white vertices. 
  * You can take one of the chains and connect any of its vertices to any white vertex of the tree with an edge. The chain becomes part of the tree. Both endpoints of this edge become black. 
  * Each chain can be used no more than once. 
  * Some chains can be left unused. 



The distance between two vertices of the tree is the number of edges on the shortest path between them.

If there is at least k white vertices in the resulting tree, then the value of the tree is the distance between the root and the k-th closest white vertex.

What's the minimum value of the tree you can obtain? If there is no way to build a tree with at least k white vertices, then print -1.

Input

The first line contains two integers n and k (1 ≤ n ≤ 2 ⋅ 10^5, 2 ≤ k ≤ 10^9) — the number of chains and the minimum number of white vertices a tree should have to have a value.

The second line contains n integers l_1, l_2, ..., l_n (3 ≤ l_i ≤ 2 ⋅ 10^5) — the lengths of the chains.

Output

Print a single integer. If there is no way to build a tree with at least k white vertices, then print -1. Otherwise, print the minimum value the tree can have.

Examples

Input


1 2
3


Output


2


Input


3 3
4 3 3


Output


3


Input


3 5
4 3 4


Output


4


Input


2 10
5 7


Output


-1

Note

<image>

You are allowed to not use all the chains, so it's optimal to only use chain of length 4 in the second example.

Solution (in CPP):

Solution:
#ifdef LOCAL
#pragma warning(disable:4996)
#pragma warning(disable:4244)
#pragma warning(disable:4554)
#define gets gets_s

#endif
#include<map>
#include<set>
#include<list>
#include<cmath>
#include<stack>
#include<queue>
#include<cmath>
#include<vector>
#include<string>
#include<cctype>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<bitset>
#include<assert.h>
#include<unordered_map>
#include<ctime>
#define ll long long
#define cl(a,x) memset((a),(x),sizeof(a))
#define lson 2*i
#define rson 2*i+1
#define sf scanf
#define ull unsigned long long
#define lowbit(x) (x)&(-x)
#define pii pair<int,int>
#define pll pair<long long,long long>
#define pdd pair<double,double>
#define ti tree[i]
#define mp make_pair
#define debug cerr <<"flag" << endl;
ll q_pow(ll x, ll n, ll mod) { ll ret = 1; while (n) { if (n & 1) ret = x * ret%mod; x = x * x%mod; n >>= 1; }return ret; }
ll __gcd(ll x, ll y) { if (!y) return x; return __gcd(y, x%y); }
ll getbit(ll now) { int cnt = 0; while (now) { cnt++; now -= lowbit(now); }return cnt; }
int dx[] = { -1,1,0,0 };//上下左右
int dy[] = { 0,0,-1,1 };//
using namespace std;
const ll maxn = 4e5 + 10;
const ll INF = 0x3f3f3f3f;
const ll IINF = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
const int mod = 1e9 + 7;

///区间和
struct node {
	int l, r;
	ll lazy, sum;
	int len() {
		return this->r - this->l + 1;
	}
};
node tree[maxn * 4 + 555];
int n, m, a[maxn + 555];
int k;
ll sum;
void push_up(int i) {
	ti.sum = tree[2 * i].sum + tree[i * 2 + 1].sum;
}
void push_down(int i) {
	if (ti.lazy) {
		tree[i * 2].lazy += ti.lazy;
		tree[i * 2 + 1].lazy += ti.lazy;
		tree[i * 2].sum += ti.lazy*tree[2 * i].len();
		tree[2 * i + 1].sum += ti.lazy*tree[2 * i + 1].len();
		ti.lazy = 0;
	}
}
void build(int i, int l, int r) {
	ti.l = l, ti.r = r;
	ti.lazy = 0;
	if (l == r) {
		ti.sum = 0;
		return;
	}
	int mid = l + r >> 1;
	build(2 * i, l, mid);
	build(2 * i + 1, mid + 1, r);
	push_up(i);
}
void update(int i, int l, int r, int val) {
	if (ti.l >= l && ti.r <= r) {
		ti.sum += 1LL * val*ti.len();
		ti.lazy += val;
		return;
	}
	push_down(i);

	int mid = ti.l + ti.r >> 1;
	if (l <= mid) update(2 * i, l, r, val);
	if (r > mid) update(2 * i + 1, l, r, val);
	push_up(i);
}
int query(int i, int k) {
	if (tree[i].sum < k) return INF;
	if (ti.l == ti.r) {
		return ti.l;
	}
	push_down(i);

	if (tree[lson].sum >= k) return query(lson, k);
	else {
		k -= tree[lson].sum;
		return query(rson, k);
	}
}

void solve() {
	sf("%d%d", &n, &k);
	for (int i = 1; i <= n; i++) {
		sf("%d", &a[i]);
	}

	build(1, 1, maxn);
	int ans = INF;
	sort(a + 1, a + n + 1);
	update(1, 1, 1, 1);

	for (int i = n; i >= 1; i--) {
		int pos = query(1, 1);
		
		update(1, pos, pos, -1);
		///cerr << "pos = " << pos << endl;
		a[i]--;
		int len = a[i] / 2;

		update(1, pos + 2, pos + 1 + a[i]/2, 1);
		update(1, pos + 2, pos + 1 + a[i] - len, 1);
		ans = min(ans, query(1, k) - 1);
		///cerr << tree[1].sum << endl;
		///cerr << i << " " << ans << endl;
	}
	if (ans >= INF - 1) ans = -1;

	cout << ans << endl;
}

signed main(int argc, char *argv[]) {
	if (argc == 2 && strcmp("-debug", argv[1]) == 0) {
		freopen("in.txt", "r", stdin);
		freopen("out.txt", "w", stdout);
	}

	int t = 1;
	///cin >> t;

	while (t--) {
		solve();
	}

	return 0;
}