费用流 https://www.acwing.com/problem/content/2176/
//最大流的最小费用
#include<bits/stdc++.h>
using namespace std;
const int N = 5010, M = 100010, INF = 1e8;
int n,m,S,T;
int ne[M],e[M],f[M],w[M],h[N],idx;
int q[N],d[N],pre[N],incf[N];
bool st[N];
void add(int a,int b,int c,int d)
{
e[idx] = b,ne[idx] = h[a],f[idx] = c