#include #include #include using namespace std; typedef long long ll; int num[102400]; int main() { int t; scanf("%d",&t); ll sum = 0; while(t--) { sum = 0; int n,m; scanf("%d%d",&n,&m);; for(int i = 0;i < n;i++) { scanf("%d",&num[i]); sum+=num[i]; } while(m--) { ll ans; scanf("%I64d",&ans); if(ans>sum) printf("1"); else printf("0"); } printf("\n"); } return 0; }