#include #define i64 long long #define lld "%I64d" int T, n, m; i64 v, s, q; int main() { scanf("%d", &T); while (T--) { scanf("%d %d", &n, &m); for (s = 0; n--; s += v) scanf(lld, &v); while (m--) scanf(lld, &q), putchar('0' + (q > s)); putchar('\n'); } return 0; }