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 SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int (X); scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define RS(X) scanf("%s", (X))
#define CASET int ___T, case_n = 1; scanf("%d ", &___T); while (___T-- > 0)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
#define RF(x) freopen(x,"r",stdin)
#define WF(x) freopen(x,"w",stdout)
typedef long long LL;
using namespace std;
typedef pair<LL,LL> PLL;
typedef pair<int,int> PII;
const LL MOD = (LL)998244353;
const int SIZE = 1<<19;
const LL INF = 1LL<<60;
const double eps = 1e-4;
const double PI=3.1415926535897932;

int a[200009];
LL fw[2][SIZE];

LL qu(int i, int x){
    LL ans = 0;
    for(;x;x-=x&(-x))ans+=fw[i][x];
    return ans;
}

void up(int i, int x,int v){
    for(;x<SIZE;x+=x&(-x))fw[i][x]+=v;
}

void upr(int a, int b, LL v){
    a++;b++;
    up(1,a,v);
    up(1,b+1,-v);
    up(0,a,-v*(a-1));
    up(0,b+1,v*b);
}

LL qur(int x){
    x++;
    return qu(1,x)*x+qu(0,x);
}

int bs(LL v){
    int x = 0;
    LL m=0, c=0;
    for(int bi = 18;bi>=0;bi--){//largest position with value < v
        int nx = x + (1<<bi);
        LL nm = m + fw[1][nx];
        LL nc = c + fw[0][nx];
        if(nm*nx+nc < v){
            x = nx;
            m = nm;
            c = nc;
        }
    }
    return x;
}

int main(){
    DRII(n,k);
    REP(i,n){
        RI(a[i]);
    }
    upr(0,0,1);//height of 0 has 1!
    int mh = 0;
    int ans = 1e9;
    sort(a,a+n,greater<int>());
    REP(i,n){
        while(qur(mh)==0)mh++;
        upr(mh,mh,-1);
        int l = (a[i]-1)/2; 
        int r = a[i]-1 - l;
        //printf("%d %d %d\n",mh,l,r);
        upr(mh+2, mh+l+1, 1);
        upr(mh+2, mh+r+1, 1);
        int bsr = bs(k);
        if(bs(k)!=SIZE-1)ans = min(ans, bsr);
        //REP(j,10)printf("%lld ",qur(j));
        //puts("");
    }
    if(ans<1e9)printf("%d", ans);
    else puts("-1");
}