public void Solve() { var n = sc.Integer(); var g = sc.Integer(); var E = sc.Integer(); var p = sc.Integer(g); var G = new MaxFlow(n + 1); for (int i = 0; i < E; i++) { var a = sc.Integer(); var b = sc.Integer(); G.AddUndirectedEdge(a, b, 1); } foreach (var q in p) { G.AddDirectedEdge(q, n, 1); } var cost = G.GetMaxFlow(0, n); IO.Printer.Out.WriteLine(cost); }