给一张n个点m条带权边的有向图,有x个人从起点出发到终点,每个人带的都带相同重量的货物,
规定一条边最多能经过其上权的重量的货物,问最多能带多重的货物?
2 ≤ n ≤ 50, 1 ≤ m ≤ 500, 1 ≤ x ≤ 100 000

二分每个人带的货物
只要把每条边最多能经过几个人算出来,跑流,看最多能让几人通过

考虑点数小,网络流可以乱搞

#include<bits/stdc++.h>
using namespace std;
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
For(j,m-1) cout<<a[i][j]<<' ';\
cout<<a[i][m]<<endl; \
}
typedef long long ll;
typedef unsigned long long ull;
ll mul(ll a,ll b){return (a*b)%F;}
ll add(ll a,ll b){return (a+b)%F;}
ll sub(ll a,ll b){return (a-b+llabs(a-b)/F*F+F)%F;}
void upd(ll &a,ll b){a=(a%F+b%F)%F;}
int read()
{
int x=0,f=1; char ch=getchar();
while(!isdigit(ch)) {if (ch=='-') f=-1; ch=getchar();}
while(isdigit(ch)) { x=x*10+ch-'0'; ch=getchar();}
return x*f;
}
#define
int n,m;
ll x,a[MAXN][MAXN],adj[MAXN][MAXN];
int used[MAXN];
int calc(int s,int t,int c) {
if (s==t) return 1;
if (used[s]) return 0;
used[s]=1;
For(i,n) if (s!=i&&adj[s][i]>=c){
if (calc(i,t,c)) {
adj[s][i]-=c;
adj[i][s]+=c;
return 1;
}
}
return 0;
}
int main()
{
// freopen("CF653D.in","r",stdin);
// freopen(".out","w",stdout);

cin>>n>>m>>x;
MEM(a)
For(i,m) {
int x=read(),y=read();
a[x][y]=read();
}
double l=0,r=1e9;
For(iter,100) {
double m=(l+r)/2;
For(i,n) For(j,n) adj[i][j]=(double)a[i][j]/m;
ll c=100000,ans=0;
while(c) {
for(;memset(used,0,sizeof(used)), calc(1,n,c);) ans+=c;
c/=2;
}
if (ans>=x) l=m;else r=m;
}

printf("%.8lf\n",r*x);
return 0;
}