P10612 [AOJ] Minimum Cost Flow
普及
题目描述

Examples

Input

4 5 2
0 1 2 1
0 2 1 2
1 2 1 1
1 3 1 3
2 3 2 1

Output

6

Input

Output

输入格式

见题面

输出格式

见题面

样例输入
4 5 2 0 1 2 1 0 2 1 2 1 2 1 1 1 3 1 3 2 3 2 1
样例输出
6