Maximum Flow A
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
The undirected graph without loops and multiple edges with vertices is given (the vertices are numbered from to ). For each edge we know its capacity. Find the value of the maximum flow from the vertex to the vertex . The current can flow along each edge in both directions.
Input
Two numbers and — the number of vertices and edges in a graph. Each of the next lines contains three numbers — the vertices, connected with an edge, and the capacity of this edge.
Output
Print the maximum flow from the vertex to the vertex .
Examples
Input #1
Answer #1
Submissions 765
Acceptance rate 41%