#include #include #include #include #include using namespace std; typedef long long LL; const int MaxN = 1e5; int T, n, m; LL a[MaxN + 5], sum; int main() { scanf("%d", &T); for (int i = 1; i <= T; i++) { sum = 0; scanf("%d%d", &n, &m); for (int i = 1; i <= n; i++) scanf("%I64d", &a[i]), sum += a[i]; for (int i = 1; i <= m; i++) { LL q; scanf("%I64d", &q); if (q > sum) printf("1"); else printf("0"); } printf("\n"); } }