#include #include using namespace std; const int N = 100; //max number of vertices in one part const int INF = 100000000; //just infinity int cost[N][N]; //cost matrix int n, max_match; //n workers and n jobs int lx[N], ly[N]; //labels of X and Y parts int xy[N]; //xy[x] - vertex that is matched with x, int yx[N]; //yx[y] - vertex that is matched with y bool S[N], T[N]; //sets S and T in algorithm int slack[N]; //as in the algorithm description int slackx[N]; //slackx[y] such a vertex, that // l(slackx[y]) + l(y) - w(slackx[y],y) = slack[y] int prev[N]; //array for memorizing alternating paths void init_labels() { for(int i=0; i> ncase; for(int icase=1; icase<=ncase; icase++) { cin >> n; for(int i=0; i> a[i][j]; a[j][i] = a[i][j]; } } /* for(int i=0; i