#include #include #include #include #include #include #include #include using namespace std; const int MAXN = 111; int n; vector g[MAXN]; int match[MAXN], p[MAXN], base[MAXN], q[MAXN]; bool used[MAXN], blossom[MAXN]; int lca (int a, int b) { bool used[MAXN] = { 0 }; for (;;) { a = base[a]; used[a] = true; if (match[a] == -1) break; // ????? ?? ????? a = p[match[a]]; } for (;;) { b = base[b]; if (used[b]) return b; b = p[match[b]]; } } void mark_path (int v, int b, int children) { while (base[v] != b) { blossom[base[v]] = blossom[base[match[v]]] = true; p[v] = children; children = match[v]; v = p[match[v]]; } } int find_path (int root) { memset (used, 0, sizeof used); memset (p, -1, sizeof p); for (int i=0; i> T; while (T){ T--; int m, xx, yy; cin >> n >> m; if (n > 100) exit(0); for (i=0;i> xx >> yy; xx--;yy--; g[xx].push_back(yy); g[yy].push_back(xx); } memset (match, -1, sizeof match); for (i=0; i