import sys input = sys.stdin.readline T=int(input()) for tests in range(T): n,m=map(int,input().split()) L=list(map(int,input().split())) R=list(map(int,input().split())) if sum(L)<=m<=sum(R): pass else: print(-1) continue OK=0 NG=10**9+1 while OK+1