#include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i, a, b) for (int i = (a), i##_end_ = (b); i < i##_end_; ++i) #define MP make_pair #define PB push_back #define SZ(x) (int((x).size())) #define ALL(x) (x).begin(), (x).end() #define X first #define Y second template inline bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; } template inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; } template inline bool RD(T &ret) { char c; int sgn; if (c = getchar(), c == EOF) return 0; while (c != '-' && (c<'0' || c>'9')) c = getchar(); sgn = (c == '-') ? -1 : 1 , ret = (c == '-') ? 0 : (c - '0'); while (c = getchar(), c >= '0'&&c <= '9') ret = ret * 10 + (c - '0'); ret *= sgn; return 1; } template inline void PT(T x) { if (x < 0) putchar('-') ,x = -x; if (x > 9) PT(x / 10); putchar(x % 10 + '0'); } const int INF = 0x3f3f3f3f; typedef long long LL; typedef pair pii; typedef long double LD; const int N = 1e6 + 100; int main() { int T; RD(T); while(T --) { int n, m; RD(n), RD(m); LL sum = 0; for(int i = 1; i<= n; i ++) { LL t; RD(t); sum += t; } while(m --) { LL q; RD(q); if(q > sum) putchar('1'); else putchar('0'); } puts(""); } }