#include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair PII; #define fi first #define se second #define MP make_pair int read() { int v = 0, f = 1; char c = getchar(); while (c < 48 || 57 < c) {if (c == '-') f = -1; c = getchar();} while (48 <= c && c <= 57) v = v * 10 + c - 48, c = getchar(); return v * f; } void Main() { int n, m; n = read(), m = read(); ll s = 0; while (n--) s += read(); while (m--) { ll a; scanf("%I64d", &a); if (a > s) printf("1"); else printf("0"); } puts(""); } int main() { int T = read(); while (T--) Main(); }