You are given an array \(A[]\) consisting of \(N\) non-negative integers. Now, you need to answer \(Q\) queries of the following type given an integer K in each query.
You need to find the minimum length L of any subarray of A, such that if all elements of this subarray are represented in binary notation and concatenated to form a binary string, then no of 1's in the resulting string is at least K.
Input Format:
The first line of the input consists of two space-separated integers N and Q.
The second line contains N space separated integers, where the \(i^{th}\)integer denotes \(A[i]\)
Next Q lines contains a non-negative integer K.
Output Format:
For each query out of the Q ones, print the answer on a new line. If for a paritcular query no valid subarray exists, then print -1 instead as the answer to that query.
Constraints:
\(1 \le N \le 100000 \\ 1 \le Q \le 5 \\ 0 \le K \le 10^9 \\ 0 \le A[i] \le 10^9 \\\)