#M002. [模板题]最大流
[模板题]最大流
Problem Description
This is a template problem.
Given vertices and directed edges, each with a specified capacity, determine the maximum flow from vertex to vertex .
Input Format
The first line contains four integers , , , and .
The following lines each contain three integers , , and , representing a directed edge from vertex to vertex with a capacity .
Output Format
Output the maximum flow from vertex to vertex .
Example Input
7 14 1 7
1 2 5
1 3 6
1 4 5
2 3 2
2 5 3
3 2 2
3 4 3
3 5 3
3 6 7
4 6 5
5 6 1
6 5 1
5 7 8
6 7 7
Example Output
14