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 JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class problemF {
    static class Solution {
//        void solve3() {
//            SegmentTree st = new SegmentTree(1,6);
//            st.rangeAdd(1,1, 2);
//            st.rangeAdd(2,3, 4);
//            debug(st.totalSum()); // 2 4 4 0 0 0                --> 10
//            debug(st.minIndexWithPrefixSum(14)); //          --> -1
//            debug(st.minIndexWithPrefixSum(10)); //          --> 3
//            debug(st.minIndexWithPrefixSum(6)); //           --> 2
//            debug(st.minIndexWithPrefixSum(4)); //           --> 2
//            debug(st.minIndexWithPrefixSum(7)); //           --> 3
//            st.rangeAdd(3, 5, -1);
//            debug(st.totalSum()); // 2 4 3 -1 -1 0              --> 7
//            st.rangeAdd(2,4, 2);
//            debug(st.totalSum()); // 2 6 5 1 -1 0               --> 13
//        }

        void solve() {
            int n = fs.nextInt();
            long k = fs.nextInt();

            int[] l = fs.readArray(n);
            Arrays.sort(l);

            SegmentTree segmentTree = new SegmentTree(0, 1000_00 + 15);
            segmentTree.rangeAdd(0,0,1);

            int ans = Integer.MAX_VALUE;
            for (int ind = n-1; ind >= 0 ; ind --) {
                int len = l[ind];
                int half = len/2;
                int other = (len&1) == 1 ? half : half-1;

                int first = segmentTree.minIndexWithPrefixSum(1);
                segmentTree.rangeAdd(first, first, -1);
                segmentTree.rangeAdd(first+2, first+2+half-1, 1);
                segmentTree.rangeAdd(first+2, first+2+other-1, 1);

                int temp = segmentTree.minIndexWithPrefixSum(k);
                if (temp != -1) ans = Math.min(ans, temp);

                // debug(ind, len, segmentTree.totalSum(), temp, ans);
            }

            out.println(ans == Integer.MAX_VALUE ? -1 : ans);
        }

        class SegmentTree {
            int l, r;
            long sum;
            long lazy;
            SegmentTree left, right;

            SegmentTree(int l, int r) {
                this.l = l; this.r = r;
                if (this.l == this.r) return;

                int mid = (l+r)/2;
                if (mid >= l) this.left = new SegmentTree(l, mid);
                if (r >= mid+1) this.right = new SegmentTree(mid+1, r);
            }

            void rangeAdd(int s, int e, int delta) {
                // 1. Non intersecting. Nothing to update.
                if (e < s || this.r < s || e < this.l) return;

                // 2. Subrange. Swallow it whole.
                if (s <= this.l && this.r <= e) {
                    this.lazy += delta;
                    return;
                }

                // 3. Intersecting.
                if (this.lazy != 0) this.pushDown();
                this.left.rangeAdd(s, e, delta);
                this.right.rangeAdd(s, e, delta);

                this.sum = (this.left == null ? 0 : this.left.totalSum())
                        + (this.right == null ? 0 : this.right.totalSum());
            }

            long totalSum() {
                return this.sum + (this.r - this.l + 1) * this.lazy;
            }

            int minIndexWithPrefixSum(long x) {
                if (this.totalSum() < x) return -1;
                if (this.l == this.r) return this.l;
                if (this.lazy != 0) this.pushDown();
                if (this.left.totalSum() >= x) return this.left.minIndexWithPrefixSum(x);
                else return this.right.minIndexWithPrefixSum(x - this.left.totalSum());
            }

            void pushDown() {
                if (this.l == this.r) {
                    this.sum += this.lazy;
                    this.lazy = 0;
                    return;
                }
                this.left.lazy += this.lazy;
                this.right.lazy += this.lazy;
                this.sum = this.left.totalSum() + this.right.totalSum();
                this.lazy = 0;
            }
        }
    }

    public static void main(String[] args) throws Exception {
        int T = 1;
        Solution solution = new Solution();
        for (int t = 0; t < T; t++) solution.solve();
        out.close();
    }

    static void debug(Object... O) {
        System.err.println("DEBUG: " + Arrays.deepToString(O));
    }

    private static FastScanner fs = new FastScanner();
    private static PrintWriter out = new PrintWriter(System.out);

    static class FastScanner { // Thanks SecondThread.
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");

        String next() {
            while (!st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) a[i] = nextInt();
            return a;
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextString() {
            return next();
        }
    }
}