#include <bits/stdc++.h>
using namespace std;
vector<int>v[100001];//记录边
vector<int>w[100001];//记录边权
int a[201][201];//记录反边的序号
int n,m,sum;
int shen[100001];//记录深度
bool bfs()
{
for(int i=0; i<=n; i++)
shen[i]=-1;
shen[1]=0;
queue<int>q;
q.push(1);
while(!q.empty())
{
int t=q.front();
for(int i=0; i<v[t].size(); i++)
{
if(shen[v[t][i]]==-1&&w[t][i])
shen[v[t][i]]=shen[t]+1,q.push(v[t][i]);
}
q.pop();
}
if(shen[n]==-1)
return 0;
return 1;
}
int dfs(int dian,int liu)
{
if(dian==n)
return liu;
int SUM=liu;
for(int i=0; i<v[dian].size(); i++)
{
if(w[dian][i]&&shen[v[dian][i]]==shen[dian]+1)
{
int d=dfs(v[dian][i],min(liu,w[dian][i]));
w[dian][i]-=d,w[v[dian][i]][a[dian][v[dian][i]]]+=d;
SUM-=d;
if(SUM==0)
break;
}
}
return liu-SUM;
}
int dinic()
{
int ANS=0;
while(bfs())
ANS+=dfs(1,INT_MAX);
return ANS;
}
int main()
{
cin>>n>>m>>sum;
int x,y,z;
while(m--)
{
cin>>x>>y>>z;
v[x].push_back(y),w[x].push_back(z);
v[y].push_back(x),w[y].push_back(0);
a[x][y]=v[y].size()-1,a[y][x]=v[x].size()-1;
}
int num=dinic();
if(num==0)
cout<<"Orz Ni Jinan Saint Cow!";
else
{
cout<<num<<" ";
if(sum%num==0)
cout<<sum/num;
else
cout<<sum/num+1;
}
return 0;
}
dinic写法,求助/kk
绝对是小白今天上午才学的