#include #include #include #include #include #include #include #include #include #include #include #include #define m_p make_pair #define p_b push_bakc #define fi first #define se second #define LL long long using namespace std; int main() { //freopen("input.txt","r",stdin); //freopen("output.txt","w",stdout); int tt;scanf("%d",&tt); while (tt--) { int n,m; scanf("%d%d",&n,&m); LL sum=0; for (int i=1; i<=n; i++) { int x; scanf("%d",&x); sum=sum+x; } for (int i=1; i<=m; i++) { LL x; scanf("%I64d",&x); if (x>sum) printf("1"); else printf("0"); } printf("\n"); } return 0; }