#include #include #include #include #include #include #include #define inf 999999999 #define mo 1000000007 #define LL long long using namespace std; int n,m,v,t; LL x,ma; int main() { scanf("%d",&t); while (t--) { ma=0; scanf("%d%d",&n,&m); for (int i=1;i<=n;i++) { scanf("%d",&v); ma+=v; } for (int i=1;i<=m;i++) { scanf("%I64d",&x); if (x>ma) printf("1"); else printf("0"); } printf("\n"); } return 0; }