#include #include #include #include #include #include using namespace std; int b[505][505]; int num[1005]; int main() { int t; scanf("%d",&t); while(t--) { memset(b,0,sizeof(b)); memset(num,0,sizeof(num)); int n; scanf("%d",&n); maps; int cont=1; for(int i=0;i