//#pragma comment(linker,"/STACK:102400000,102400000") #include #include #include #include #include #include #include #include #include #include #define ll long long #define db double #define PB push_back #define lson k<<1 #define rson k<<1|1 using namespace std; const int N = 20; const int INF = 1000000000; int mp[N][N]; int f[1<<16][16]; int main() { #ifdef PKWV // freopen("in.in","r",stdin); #endif // PKWV int T; scanf("%d",&T); while(T--) { int n,m; scanf("%d%d",&n,&m); for(int i=0;i>k)&1){} else { f[i|(1<