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