//#pragma comment(linker, "/STACK:102400000,102400000") #include #include //#include #include #include #include #include #include #include #include #include #include #include //#include #define Size 10000005 #define N 45 #define inf 2e9 #define INF 2e18 #define LL long long int #define i64 __int64 #define ULL unsigned long long #define Mod 1000000007 #define pi 4*atan(1) #define eps 1e-8 #define lson now*2,l,l+(r-l)/2 #define rson now*2+1,l+(r-l)/2+1,r using namespace std; LL n,m,k; LL MOD = Mod; int ql,qr,pos; LL gcd(LL a,LL b)//gcd { return b == 0?a:gcd(b,a%b); } LL quickMod(LL a, LL b, LL mod)//基于快速乘法取模的快速幂取模 ///重点!!!!!如果能够改成int且满足题目要求一定要改,速度比LL快两倍 { if(b == 0) return 1%mod; LL c = a%mod; LL ans = 1; while(b) { if(b&1) { // ans = multi(ans,c,mod);//根据题目要求选择乘法方式 ans = ans * c % mod; } // c = multi(c,c,mod); c = c * c % mod; b >>= 1; } return ans; } LL exGcd(LL a, LL b, LL &x, LL &y)///扩展欧几里得,返回a b的gcd,x,y分别为a b的系数 { if(a==0&&b==0) return -1; if(!b) { x=1,y=0; return a; } else { LL tmp = exGcd(b,a%b,y,x); y-=x*(a/b); return tmp; } } ///乘法逆元: ///直接求逆元: LL modInver(LL a, LL mod)///乘法逆元 扩展欧几里得法,对于mod不是质数但与a 互质使有效 { LL x,y,g; LL gcd = exGcd(a,mod,x,y); if(gcd == 1) return (x%mod+mod)%mod; return -1; } int main() { #ifndef ONLINE_JUDGE // freopen("input.txt","r",stdin); // freopen("output.txt","w",stdout); #endif // ONLINE_JUDGE int t; LL x,y,z; LL a,b,c,d; LL Case = 0; cin>>t; while(t--) // while(scanf("%I64d%I64d%",&n, &m) == 2) { scanf("%I64d%I64d",&n, &m); LL tmp = 0; LL sum = 0; for(LL i = 0; i < n; ++i) { scanf("%I64d",&tmp); sum += tmp; } for(LL i = 0; i < m; ++i) { scanf("%I64d",&tmp); if(tmp > sum) { printf("1"); } else { printf("0"); } } cout<