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:
#include <bits/stdc++.h>
#define all(n) (n).begin(), (n).end()
#define se second
#define fi first
#define pb push_back
#define mp make_pair
#define sqr(n) (n) * (n)
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define per(i, a, b) for (int i = (a); i >= (b); --i)
#define precision(a) setiosflags(ios::fixed) << setprecision(a)
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef vector<int> VI;
typedef vector<long long> VL;
typedef double db;

template <typename T> inline char read(T& x) {
    x = 0; T fg = 1; char ch = getchar();
    while (!isdigit(ch)) { if (ch == '-') fg = -1; ch = getchar(); }
    while (isdigit(ch)) x = (x << 3) + (x << 1) + (ch ^ '0'), ch = getchar();
    x = fg * x; return ch;
}
template <typename T, typename... Args> inline void read(T& x, Args &... args) { read(x), read(args...); }
template <typename T> inline void write(T x) {
    int len = 0; char c[21]; if (x < 0) putchar('-'), x = -x;
    do { ++len; c[len] = x % 10 + '0'; } while (x /= 10);
    for (int i = len; i >= 1; i--) putchar(c[i]);
}
template <typename T, typename... Args> inline void write(T& x, Args &... args) { write(x), write(args...); }

template<class T1, class T2> bool umin(T1& a, T2 b) { return a > b ? (a = b, true) : false; }
template<class T1, class T2> bool umax(T1& a, T2 b) { return a < b ? (a = b, true) : false; }
template<class T> void clear(T& a) { T().swap(a); }

const int N = 1151300;

int n, m, _, k;
ll c[2][N + 1], ans = 2e18;

void add(int x, ll k) {
    for (int i = x; i <= N; i += -i & i) c[0][i] += k, c[1][i] += x * k;
}

void add(int l, int r, ll k) { add(l, k); add(r + 1, -k); }

ll ask(int x) {
    ll p = 0, q = 0, f = x + 1;
    for (; x; x -= -x & x) p += c[0][x], q += c[1][x];
    return p * f - q;
}

ll ask(int l, int r) { return ask(r) - ask(l - 1); }

ll kth(int k) {
    if (ask(N) < k) return 2e18;
    int l = 1, r = N;
    while (l < r) {
        ll mid = l + r >> 1, c;
        if ((c = ask(l, mid)) < k) k -= c, l = mid + 1;
        else r = mid; 
    }
    return l;
}

int main() {
    IOS; cin >> n >> k; VI a(n);
    for (auto &i : a) cin >> i, --i; sort(all(a));
    add(2, 2 + a.back() >> 1, 1); add(2, 2 + a.back() + 1 >> 1, 1); umin(ans, kth(k));
    per (i, n - 2, 0) {
        int cur = kth(1); add(cur, cur, -1);
        add(cur + 2, 1 + cur + (a[i] >> 1), 1); add(cur + 2, 1 + cur + (a[i] + 1 >> 1), 1);
        umin(ans, kth(k));
    }
    cout << (ans == 2e18 ? -1 : ans);
    return 0;
}