voidAddedge(int from, int to, int cap) { edges.push_back(Edge(from, to, cap, 0)); edges.push_back(Edge(to, from, 0, 0)); m = edges.size(); G[from].push_back(m-2); G[to].push_back(m-1); }
} } for (int i = 1; i <= n; i++) { if (!vis[i]) { int x = i; while (x) { printf("%d ", x); vis[x] = 1; x = to[x]; } printf("\n"); } } printf("%d\n", ans); }