const mergeSort = arr=>{
  const merge = (arr1,arr2)=>{
    let res = [],i=0,j=0;
    while(i<arr1.length && j<arr2.length){
      if(arr1[i]>=arr2[j]) res.push(arr1[i++]);
      else res.push(arr2[j++]);
    }
    while(i<arr1.length) res.push(arr1[i++]);
    while(j<arr2.length) res.push(arr2[j++]);
    return res;
  }
  const helper = (start,end,arr)=>{
    if(start===end) return [arr[start]];
    let mid = Math.floor((start+end)/2);
    return merge(helper(start,mid,arr),helper(mid+1,end,arr));
  }
  return helper(0,arr.length-1,arr);
}
const solve = (start, end, arr, q) => {
  if (start === end) return start + 1;
  let mid = Math.floor((start + end) / 2);
  if (q > arr[mid]) return solve(mid + 1, end, arr, q);
  else if (q < arr[mid]) return solve(start, mid, arr, q);
  else return mid + 1;
};
function main() {
  const fs = require("fs");
  const input = fs.readFileSync(0, "utf8").trim().split("\n");
  let line = 0;
  function readline() {
    return input[line++];
  }
  let t = parseInt(readline());
  for (let i = 0; i < t; i++) {
    let [n, q] = readline()
      .trim()
      .split(" ")
      .map((cur) => parseInt(cur));
    let arr = mergeSort(readline().trim().split(" ").map(cur=>parseInt(cur)));
    for(let i=1;i<n;i++) arr[i]+=arr[i-1];
    for(let i=0;i<q;i++){
      let s = parseInt(readline());
      if(s>arr[n-1]) console.log(-1);
      else if(s<=arr[0]) console.log(1);
      else console.log(solve(0,n-1,arr,s));
    }
  }
}
main();

'use strict';
// HEADER:
const print = console.log;
let IS_MULTITEST, testN;
const pcalc = testN=>{
  let res = calc(testN);
  if (Array.isArray(res)){
    pa(res);
  } else if (Number.isFinite(res) || typeof res=='string'){
    print(res);
  }
};

const main = ()=>{
  if (IS_MULTITEST){
    let T = +readline()
    for (testN=1; testN<=T; testN++)
      pcalc(T);
  } else
   pcalc();
};

const lines = [];
const rl = require('readline').createInterface({
   input: process.stdin, output: process.stdout});
rl.on('line', line=>{
  lines.push(line);
});
rl.on('close', main);
let rli = 0;
const readline = ()=>lines[rli++];
const L = process.env.DEBUG ? console.log : ()=>{};
const LT = obj=>L(`Test #${testN}`, obj);

const ra = ()=>readline().split(' ').map(a=>+a)
const pa = arr=>print(arr.join(' '));

// SOLUTION:
IS_MULTITEST = 1;

const calc = ()=>{
  // READING:
  let [n, q] = ra();
  let A = ra();
  LT({n, q, A});
  // PROCESSING:
  let S = new Array(n).fill(0)
  A.sort((a, b)=>b-a);
  for (let i=0; i<n; i++){
    S[i] = (i ? S[i-1] : 0)+A[i];
  }
  let ans = (cnt)=>{
    if (S[n-1]<cnt)
      return -1;
    let l = 0, r = n;
    while (l<r){
      let m = Math.floor((l+r)/2);
      if (S[m]>=cnt){
        r = m;
      } else {
        l = m+1;
      }
    }
    return l+1;
  };
  for (let i=0; i<q; i++){
    print(ans(+readline()));
  };
};

//import { readline, print } from '@ip-algorithmics/codeforces-io';
var t = +readline();
var _loop_1 = function () {
    var _a = readline().split(' ').map(function (v) { return +v; }), n = _a[0], q = _a[1];
    var a = readline().split(' ').map(function (v) { return +v; });
    a.sort(function (a, b) { return b - a; }).reduce(function (sum, _, i) { return a[i] += sum; });
    loop: for (var i = 0; i < q; i++) {
        var k = +readline();
        var l = 0, r = n;
        while (l < r) {
            var m = Math.trunc((l + r) / 2);
            if (a[m] < k) {
                l = m + 1;
            }
            else {
                r = m;
            }
        }
        print(l === n ? -1 : l + 1);
    }
};
while (t--) {
    _loop_1();
}

const solve = (start, end, arr, q) => {
  if (start === end) return start + 1;
  let mid = Math.floor((start + end) / 2);
  if (q > arr[mid]) return solve(mid + 1, end, arr, q);
  else if (q < arr[mid]) return solve(start, mid, arr, q);
  else return mid + 1;
};
function main() {
  const fs = require("fs");
  const input = fs.readFileSync(0, "utf8").trim().split("\n");
  let line = 0;
  function readline() {
    return input[line++];
  }
  let t = parseInt(readline());
  for (let i = 0; i < t; i++) {
    let [n, q] = readline()
      .trim()
      .split(" ")
      .map((cur) => parseInt(cur));
    let arr = readline().trim().split(" ").map(cur=>parseInt(cur));
    arr.sort((a,b)=>b-a);
    for(let i=1;i<n;i++) arr[i]+=arr[i-1];
    for(let i=0;i<q;i++){
      let s = parseInt(readline());
      if(s>arr[n-1]) console.log(-1);
      else if(s<=arr[0]) console.log(1);
      else console.log(solve(0,n-1,arr,s));
    }
  }
}
main();

//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
	input: process.stdin, output: process.stdout
});
var obj; var inLine = []; var outputList = [];var retcode = new Set();
read.on('line', function(input){
	var tmp = input.split(' ');
	for(var i = 0; i < tmp.length; i++){
		inLine.push(tmp[i]);
		if(i == tmp.length - 1){
			retcode.add(inLine.length);
		}
	}
});
read.on('close', function(){
	obj = init(inLine);
	// console.error('\n↑入力 ↓出力');
	Main();
	console.log(myconv(outputList, 9));
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextArray(size, code){
	var ret = new Array(size);
	for(var i = 0; i < size; i++){
		if(code == 'int'){
			ret[i] = nextInt();
		}else if(code == 'long'){
			ret[i] = nextLong();
		}else if(code == 'double'){
			ret[i] = nextDouble();
		}else{
			ret[i] = next();
		}
	}
	return ret;
}
function nextIntArray(size){return nextArray(size, 'int');} function nextStrArray(size){return nextArray(size, 'str');} function nextLongArray(size){return nextArray(size, 'long');} function nextDoubleArray(size){return nextArray(size, 'double');}
function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();} function nextInt(){return myconv(next(),1);} function nextLong(){return BigInt(next());} function nextDouble(){return parseFloat(next());}
function getCountMap(list){
	var map = {};
	for(var i = 0; i < list.length; i++){
		if(map[list[i]] == null){
			map[list[i]] = 0;
		}
		map[list[i]]++;
	}
	return map;
}
function init(input){
	return {
		list : input, index : 0, max : input.length,
		hasNext : function(){return (this.index < this.max);},
		next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}},
		isReturn : function(){return retcode.has(this.index);}
	};
}
function myout(s){outputList.push(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
function isReturn(){return obj.isReturn();}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

function Main(){
    // test case in nodeJs
	var t = nextInt();
	while(hasNext()){
		solve();
	}
}

function solve() {
    const num = nextInt();
    const queryNo = nextInt();
    const arr = nextIntArray(num);
    const queries = nextIntArray(queryNo);
    arr.sort((a, b) => b - a)
    let sum = 0;
    const prefixSumArr = arr.map(ele => {
        sum += ele;
        return sum;
    });
    // console.log(prefixSumArr);

    for (let i = 0; i < queries.length; i++) {
        const q = queries[i];
        if (q > prefixSumArr[prefixSumArr.length - 1]) {
            myout(-1)
        } else {
            myout(bsearch(prefixSumArr, q))
            // for (let index = 0; index < prefixSumArr.length; index++) {
            //     if (q <= prefixSumArr[index]){
            //         myout(index + 1);
            //         break;
            //     }
            // }
        }
    }
}

function bsearch (prefixSumArr, q) {
    let left = 0;
    let right = prefixSumArr.length - 1;
    while (left < right) {
        const mid = Math.floor(left + (right - left )/ 2);
        if (prefixSumArr[mid] === q) {
            return mid + 1;
        } else if (prefixSumArr[mid] < q) {
            left = mid + 1;
        } else {
            right = mid;
        }
    }
    return left + 1;
}

'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
  inputString += inputStdin;
});

process.stdin.on('end', _ => {
  inputString = inputString.trim().split('\n').map(string => {
    return string.trim();
  });
  main();
});

function input() {
  return inputString[currentLine++];
}

function main() {
  let tc = parseInt(input());
  while(tc--){
    const [n, q] = input().split(' ').map(Number);
    const a = input().split(' ').map(Number);
    a.sort((a, b) => {
      if(a > b) return -1;
      else return 1;
    });
    for(let i = 1; i < n; i++){
      a[i] += a[i-1];
    }
    for(let i = 0; i < q; i++){
      let x = parseInt(input());
      let j = lower_bound(a, x);
      if(j === n) console.log(-1);
      else console.log(j+1);
    }
  }
}

const lower_bound = (a, key) => {
  let m = 0;
  let l = 0;
  let r = a.length-1;
  while(l <= r){
    m = Math.floor((l+r)/2);
    if(key <= a[m]) r = m-1;
    else l = m+1;
  }
  if(key > a[m]) return m+1;
  else return m;
}

'use strict';

var readline = require('readline');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);

function solve(n, m, a, b) {
  a.sort((a, b) => b - a);
  const query = b.map((num, i) => [num, i]).sort((a, b) => a[0] - b[0]);
  let cur = 0,
      res = [];
  let j = 0;
  for (let i = 0; i < n && j < m; i++) {
    cur += a[i];
    while (j < m && query[j][0] <= cur) {
      res[query[j][1]] = i + 1;
      j++;
    }
  }
  while (j < m) {
    res[query[j][1]] = -1;
    j++;
  }
  return res.join('\n');
}

async function main(read) {
  let t = Number(await read());
  let res = [];
  while (t--) {
    const [n, m] = (await read()).split(' ').map(Number);
    const a = (await read()).split(' ').map(Number);
    const b = [];
    let tmp = m;
    while (tmp--) {
      b.push(Number(await read()));
    }
    res.push(solve(n, m, a, b));
  }
  console.log(res.join('\n'));
}

const rl = readline__default["default"].createInterface({
  input: process.stdin,
  output: process.stdout
});
void async function () {
  const inputs = [];
  let i = 0;
  for await (const line of rl) {
    inputs.push(line.trim());
  }
  function read() {
    return inputs[i++];
  }
  await main(read);
}();

const fs = require('fs');
const input = fs.readFileSync(0, 'utf8').trim().split('\r\n');
let currentline = 0;
function readline(){
      return input[currentline++];
}

function alph() {
  var f = 'abcdefghijklmnopqrstuvwxyz';
  return f;
}
function Alph() {
  var f = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  return f;
}
function max(x,y) {
  return x >=y ? x : y;
}
function min(x,y) {
  return x <=y ? x : y;
}
var T = readline();
for(var q=1;q<=T;q++) {
  var [n, qu] = readline().split(' ').map((x)=>parseInt(x));
  var a = readline().split(' ').map((x)=>parseInt(x));
  a.sort(function(r,t) { return t-r });
  var pref = [];
  pref[0] = a[0];
  var sum = a[0];
  for(var i=1;i<n;i++) {
    pref[i] = pref[i-1]+a[i];
    sum += a[i];
  }
  for(var i=0;i<qu;i++) {
    var s =  readline();
    var ans = bin(s);
    //fs.appendFileSync('output.txt', ans+'\r\n');
    console.log(ans)
  }
  function bin(x) {
    var l=0, r=n-1;
    while(l<=r) {
      var mid = l+Math.floor((r-l)/2);
      if(pref[mid] >= x) r = mid-1;
      else l = mid+1;
    }
    return l>n-1 || l<0 ? -1 : l+1;
  }
  //console.log(q);
  //fs.appendFileSync('output.txt', tar+'\r\n');

  //os.EOL
}
//fs.writeFileSync('output.txt', f.join(' '));

const readline = require('readline')

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
})
const lines = []
rl.on('line', (input) => {
    lines.push(input);
})
rl.on('close', () => {
// (function() {
    // const lines = require('fs').readFileSync('test.in', 'utf8').split('\n')
    let l = 0;
    let t = +lines[l++]
    const output = []
    for (let i = 0; i < t; i++) {
        const [n, q] = lines[l++].trim().split(' ').map(Number)
        const arr = lines[l++].trim().split(' ').map(Number)
        const qs = lines.slice(l, l + q).map(str => str.trim().split(' ').map(Number))
        l += q
        output[i] = solve(n, arr, qs)
    }
    console.log(output.join('\n'))
// })()
})

function solve(n, arr, qs) {
    arr.sort((a, b) => b - a)
    const sum = []
    for (let i = 0; i < arr.length; i++) {
        const x = arr[i]
        sum[i] = i ? sum[i - 1] + x : x
    }
    return qs.map(q => {
        const need = binarySearch(0, n - 1, x => {
            return sum[x] < q
        }) + 1
        return need < n ? need + 1 : -1
    }).join('\n')
}
function binarySearch(l, r, fn) {
    while (l <= r) {
        const m = Math.floor((l + r) / 2)
        if (fn(m)) {
            l = m + 1
        } else {
            r = m - 1
        }
    }
    return r
}

//Don't have to see. start------------------------------------------
var read = require('readline').createInterface({
	input: process.stdin, output: process.stdout
});
var obj; var inLine = []; var outputList = [];var retcode = new Set();
read.on('line', function(input){
	var tmp = input.split(' ');
	for(var i = 0; i < tmp.length; i++){
		inLine.push(tmp[i]);
		if(i == tmp.length - 1){
			retcode.add(inLine.length);
		}
	}
});
read.on('close', function(){
	obj = init(inLine);
	console.error('\n↑入力 ↓出力');
	Main();
	console.log(myconv(outputList, 9));
});
function makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}
function nextArray(size, code){
	var ret = new Array(size);
	for(var i = 0; i < size; i++){
		if(code == 'int'){
			ret[i] = nextInt();
		}else if(code == 'long'){
			ret[i] = nextLong();
		}else if(code == 'double'){
			ret[i] = nextDouble();
		}else{
			ret[i] = next();
		}
	}
	return ret;
}
function nextIntArray(size){return nextArray(size, 'int');} function nextStrArray(size){return nextArray(size, 'str');} function nextLongArray(size){return nextArray(size, 'long');} function nextDoubleArray(size){return nextArray(size, 'double');}
function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();} function nextInt(){return myconv(next(),1);} function nextLong(){return BigInt(next());} function nextDouble(){return parseFloat(next());}
function getCountMap(list){
	var map = {};
	for(var i = 0; i < list.length; i++){
		if(map[list[i]] == null){
			map[list[i]] = 0;
		}
		map[list[i]]++;
	}
	return map;
}
function init(input){
	return {
		list : input, index : 0, max : input.length,
		hasNext : function(){return (this.index < this.max);},
		next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}},
		isReturn : function(){return retcode.has(this.index);}
	};
}
function myout(s){outputList.push(s);}
function myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}
function isReturn(){return obj.isReturn();}
//param "no" is
//unknown or outlier : return i. 1: parseInt.
//2: split space. 4: split space and parseInt.
//6: split 1 character. 7: split 1 character and parseInt.
//8: join space. 9: join nextline. 0: join no character.
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}

//Don't have to see. end------------------------------------------
function Main(){
	var t = nextInt();
	while(hasNext()){
		var N = nextInt();
		var Q = nextInt();
		var list = nextIntArray(N);
		list.sort(function(a,b){
			return b - a;
		});
		var max = 0;
		var sum = new Array(N + 1);
		sum[0] = 0;
		for(var i = 0; i < N; i++){
			sum[i + 1] = sum[i] + list[i];
		}
		max = sum[N];
		for(var i = 0; i < Q; i++){
			var xi = nextInt();
			if(max < xi){
				myout(-1);
				continue;
			}
			var index = binarySearch(sum, xi, "ceiling");
			myout(index);
		}
	}
}
function binarySearch(list, search, method){
	var ng = 0;
	var ok = list.length - 1;
	var center;
	while(Math.abs(ok - ng) > 1){
		center = Math.floor((ok + ng) / 2);
		switch(method){
			case "floor":
				if(list[center] > search){
					ok = center;
				}else{
					ng = center;
				}
				break;
			case "ceiling":
				if(list[center] < search){
					ng = center;
				}else{
					ok = center;
				}
				break;
			case "lower":
				if(list[center] >= search){
					ok = center;
				}else{
					ng = center;
				}
				break;
			case "higher":
				if(list[center] <= search){
					ng = center;
				}else{
					ok = center;
				}
				break;
		}
	}
	if(method == "floor" || method == "lower"){
		return ng;
	}else{
		return ok;
	}
}

//import { readline, print } from '@ip-algorithmics/codeforces-io';
var t = +readline();
while (t--) {
    var _a = readline().split(' ').map(function (v) { return +v; }), n = _a[0], q = _a[1];
    var a = readline().split(' ').map(function (v) { return +v; });
    a.sort();
    loop: for (var i = 0; i < q; i++) {
        var k = +readline();
        var sum = 0;
        var j = n;
        while (j--) {
            sum += a[j];
            if (sum >= k) {
                print(n - j);
                continue loop;
            }
        }
        print(-1);
    }
}