#include #include #include #include #include using namespace std; int main() { int t , n , m; scanf( "%d" , &t ); while( t-- ) { scanf( "%d%d" , &n , &m ); long long sum = 0; for( int i = 0 ; i < n ; i++ ) { int x; scanf( "%d" , &x ); sum += x; } while( m-- ) { long long x; scanf( "%I64d" , &x ); printf( "%d" , x > sum ); } printf( "\n" ); } return 0; }