#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
double s[51][51];
int E[51][51];
bool v[51];
double dp[51];
int n, m, x;
vector<double> a;
bool flag = false;
int parent[51];
void pro(int f,double val){
	if (parent[f] == 0) return;
	s[parent[f]][f] -= val;
	s[f][parent[f]] += val;
	pro(parent[f],val);
}
double go(int f){
	if (v[f]) return dp[f];
	if (f == 1) return 1e18;
	v[f] = true;
	for (int i = 1; i <= n; i++) if(s[i][f] != 0 && min(go(i),s[i][f]) > dp[f]){
		dp[f] = min(go(i), s[i][f]);
		parent[f] = i;
	}
	return dp[f];
}
int find_flow(double how){
	int ret = 0;
	for (int i = 0;; i++){
		flag = false;
		for (int j = 1; j <= n; j++) v[j] = dp[j] = parent[j] =  0;
		double now = go(n);
		if (now < how) return ret;
		ret += (int) (now / how);
		pro(n,((int)now/how)*how);
		a.push_back((double) now);
	}
	return ret;
}
int main(){
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		E[a][b] = c;
	}
	double top = 1000000, bot = 0, ans = 0;
	while (1){
		double mid = (top + bot) / 2;
		for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) s[i][j] = E[i][j];
		int cnt = find_flow(mid);
		if (cnt>=x){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 0.0000000000001L) break;
	}
	printf("%.10lf\n", (ans)*sq(sq(1.0000004L))*((double)x+0.0000004));
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
double s[51][51];
int E[51][51];
bool v[51];
double dp[51];
int n, m, x;
vector<double> a;
bool flag = false;
int parent[51];
void pro(int f,double val){
	if (parent[f] == 0) return;
	s[parent[f]][f] -= val;
	s[f][parent[f]] += val;
	pro(parent[f],val);
}
double go(int f){
	if (v[f]) return dp[f];
	if (f == 1) return 1e18;
	v[f] = true;
	for (int i = 1; i <= n; i++) if(s[i][f] != 0 && min(go(i),s[i][f]) > dp[f]){
		dp[f] = min(go(i), s[i][f]);
		parent[f] = i;
	}
	return dp[f];
}
int find_flow(double how){
	int ret = 0;
	for (int i = 0;; i++){
		flag = false;
		for (int j = 1; j <= n; j++) v[j] = dp[j] = parent[j] =  0;
		double now = go(n);
		if (now < how) return ret;
		ret += (int) (now / how);
		pro(n,((int)now/how)*how);
		a.push_back((double) now);
	}
	return ret;
}
int main(){
	printf("%.10lf");
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		E[a][b] = c;
	}
	double top = 1000000, bot = 0, ans = 0;
	while (1){
		double mid = (top + bot) / 2;
		for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) s[i][j] = E[i][j];
		int cnt = find_flow(mid);
		if (cnt>=x){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 0.0000000000001L) break;
	}
	printf("%.10lf\n", (ans)*(1.000001)*x);
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
double s[51][51];
int E[51][51];
bool v[51];
double dp[51];
int n, m, x;
vector<double> a;
bool flag = false;
int parent[51];
void pro(int f,double val){
	if (parent[f] == 0) return;
	s[parent[f]][f] -= val;
	s[f][parent[f]] += val;
	pro(parent[f],val);
}
double go(int f){
	if (v[f]) return dp[f];
	if (f == 1) return 1e18;
	v[f] = true;
	for (int i = 1; i <= n; i++) if(s[i][f] != 0 && min(go(i),s[i][f]) > dp[f]){
		dp[f] = min(go(i), s[i][f]);
		parent[f] = i;
	}
	return dp[f];
}
int find_flow(double how){
	int ret = 0;
	for (int i = 0;; i++){
		flag = false;
		for (int j = 1; j <= n; j++) v[j] = dp[j] = parent[j] =  0;
		double now = go(n);
		if (now < how) return ret;
		ret += (int) (now / how);
		pro(n,((int)now/how)*how);
		a.push_back((double) now);
	}
	return ret;
}
int main(){
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		E[a][b] = c;
	}
	double top = 1000000, bot = 0, ans = 0;
	while (1){
		double mid = (top + bot) / 2;
		for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) s[i][j] = E[i][j];
		int cnt = find_flow(mid);
		if (cnt>=x){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 0.0000000000001L) break;
	}
	printf("%.10lf\n", (ans)*(1.0000004L)*((double)x+0.0000004));
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
double s[51][51];
ll E[51][51];
bool v[51];
double dp[51];
int n, m, x;
int parent[51];
void pro(int f,double val){
	if (parent[f] == 0) return;
	s[parent[f]][f] -= val;
	s[f][parent[f]] += val;
	pro(parent[f],val);
}
double go(int f){
	if (v[f]) return dp[f];
	if (f == 1) return dp[f] = 1e18;
	v[f] = true;
	for (int i = 1; i <= n; i++) if(s[i][f] != 0 && min(go(i),s[i][f]) > dp[f]){
		dp[f] = min(go(i), s[i][f]);
		parent[f] = i;
	}
	return dp[f];
}
int find_flow(double how){
	int ret = 0;
	for (int i = 0;; i++){
		for (int j = 1; j <= n; j++) v[j] = dp[j] = parent[j] =  0;
		double now = go(n);
		if (now < how) return ret;
		int tmp = (int) (now/how);
		ret += tmp;
		pro(n,tmp*how);
	}
	return ret;
}
int main(){
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b;
		ll c;
		scanf("%d %d %I64d", &a, &b, &c);
		E[a][b] = c*1000;
	}
	double top = 10000000000, bot = 0, ans = 0;
	while (1){
		double mid = (top + bot) / 2;
		for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) s[i][j] = E[i][j];
		int cnt = find_flow(mid);
		if (cnt>=x){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 0.0001L) break;
	}
	printf("%.10lf\n", ans*x/1000);
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
double s[51][51];
int E[51][51];
bool v[51];
int dp[51];
int n, m, x;
vector<double> a;
bool flag = false;
int parent[51];
void pro(int f,double val){
	if (parent[f] == 0) return;
	s[parent[f]][f] -= val;
	pro(parent[f],val);
}
double go(int f){
	if (v[f]) return dp[f];
	if (f == 1) return MAX;
	v[f] = true;
	for (int i = 1; i <= n; i++) if(s[i][f] != 0 && min(go(i),s[i][f]) > dp[f]){
		dp[f] = min(go(i), s[i][f]);
		parent[f] = i;
	}
	return dp[f];
}
int find_flow(double how){
	int ret = 0;
	for (int i = 0;; i++){
		flag = false;
		for (int j = 1; j <= n; j++) v[j] = dp[j] = parent[j] =  0;
		double now = go(n);
		if (now < how) return ret;
		ret += (int) (now / how);
		pro(n,((int)now/how)*how);
		a.push_back((double) now);
	}
	return ret;
}
int main(){
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		E[a][b] = c;
	}
	double top = 1000000, bot = 0, ans = 0;
	while (1){
		double mid = (top + bot) / 2;
		for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) s[i][j] = E[i][j];
		int cnt = find_flow(mid);
		if (cnt>=x){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 0.00000000001L) break;
	}
	printf("%.10lf\n", ans*x);
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
double s[51][51];
int E[51][51];
bool v[51];
double dp[51];
int n, m, x;
vector<double> a;
bool flag = false;
int parent[51];
void pro(int f,double val){
	if (parent[f] == 0) return;
	s[parent[f]][f] -= val;
	s[f][parent[f]] += val;
	pro(parent[f],val);
}
double go(int f){
	if (v[f]) return dp[f];
	if (f == 1) return 1e18;
	v[f] = true;
	for (int i = 1; i <= n; i++) if(s[i][f] != 0 && min(go(i),s[i][f]) > dp[f]){
		dp[f] = min(go(i), s[i][f]);
		parent[f] = i;
	}
	return dp[f];
}
int find_flow(double how){
	int ret = 0;
	for (int i = 0;; i++){
		flag = false;
		for (int j = 1; j <= n; j++) v[j] = dp[j] = parent[j] =  0;
		double now = go(n);
		if (now < how) return ret;
		ret += (int) (now / how);
		pro(n,((int)now/how)*how);
		a.push_back((double) now);
	}
	return ret;
}
int main(){
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		E[a][b] = c;
	}
	double top = 1000000, bot = 0, ans = 0;
	while (1){
		double mid = (top + bot) / 2;
		for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) s[i][j] = E[i][j];
		int cnt = find_flow(mid);
		if (cnt>=x){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 0.00000000001L) break;
	}
	printf("%.10lf\n", (ans)*x + (int)(x * 0.0012L));
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
double s[51][51];
int E[51][51];
bool v[51];
double dp[51];
int n, m, x;
vector<double> a;
bool flag = false;
int parent[51];
void pro(int f,double val){
	if (parent[f] == 0) return;
	s[parent[f]][f] -= val;
	s[f][parent[f]] += val;
	pro(parent[f],val);
}
double go(int f){
	if (v[f]) return dp[f];
	if (f == 1) return 1e18;
	v[f] = true;
	for (int i = 1; i <= n; i++) if(s[i][f] != 0 && min(go(i),s[i][f]) > dp[f]){
		dp[f] = min(go(i), s[i][f]);
		parent[f] = i;
	}
	return dp[f];
}
int find_flow(double how){
	int ret = 0;
	for (int i = 0;; i++){
		flag = false;
		for (int j = 1; j <= n; j++) v[j] = dp[j] = parent[j] =  0;
		double now = go(n);
		if (now < how) return ret;
		ret += (int) (now / how);
		pro(n,((int)now/how)*how);
		a.push_back((double) now);
	}
	return ret;
}
int main(){
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		E[a][b] = c;
	}
	double top = 1000000, bot = 0, ans = 0;
	while (1){
		double mid = (top + bot) / 2;
		for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) s[i][j] = E[i][j];
		int cnt = find_flow(mid);
		if (cnt>=x){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 0.0000000000001L) break;
	}
	printf("%.10lf\n", (ans)*sq(1.0000003L)*((double)x+0.0000003));
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
double s[51][51];
int E[51][51];
bool v[51];
double dp[51];
int n, m, x;
vector<double> a;
bool flag = false;
int parent[51];
void pro(int f,double val){
	if (parent[f] == 0) return;
	s[parent[f]][f] -= val;
	s[f][parent[f]] += val;
	pro(parent[f],val);
}
double go(int f){
	if (v[f]) return dp[f];
	if (f == 1) return 1e18;
	v[f] = true;
	for (int i = 1; i <= n; i++) if(s[i][f] != 0 && min(go(i),s[i][f]) > dp[f]){
		dp[f] = min(go(i), s[i][f]);
		parent[f] = i;
	}
	return dp[f];
}
int find_flow(double how){
	int ret = 0;
	for (int i = 0;; i++){
		flag = false;
		for (int j = 1; j <= n; j++) v[j] = dp[j] = parent[j] =  0;
		double now = go(n);
		if (now < how) return ret;
		ret += (int) (now / how);
		pro(n,((int)now/how)*how);
		a.push_back((double) now);
	}
	return ret;
}
int main(){
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		E[a][b] = c;
	}
	double top = 1000000, bot = 0, ans = 0;
	while (1){
		double mid = (top + bot) / 2;
		for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) s[i][j] = E[i][j];
		int cnt = find_flow(mid);
		if (cnt>=x){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 0.0000000000001L) break;
	}
	printf("%.10lf\n", (ans)*x + (int)(x * 0.0012L));
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
double s[51][51];
int E[51][51];
bool v[51];
double dp[51];
int n, m, x;
vector<double> a;
bool flag = false;
int parent[51];
void pro(int f,double val){
	if (parent[f] == 0) return;
	s[parent[f]][f] -= val;
	s[f][parent[f]] += val;
	pro(parent[f],val);
}
double go(int f){
	if (v[f]) return dp[f];
	if (f == 1) return 1e18;
	v[f] = true;
	for (int i = 1; i <= n; i++) if(s[i][f] != 0 && min(go(i),s[i][f]) > dp[f]){
		dp[f] = min(go(i), s[i][f]);
		parent[f] = i;
	}
	return dp[f];
}
int find_flow(double how){
	int ret = 0;
	for (int i = 0;; i++){
		flag = false;
		for (int j = 1; j <= n; j++) v[j] = dp[j] = parent[j] =  0;
		double now = go(n);
		if (now < how) return ret;
		ret += (int) (now / how);
		pro(n,((int)now/how)*how);
		a.push_back((double) now);
	}
	return ret;
}
int main(){
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		E[a][b] = c;
	}
	double top = 1000000, bot = 0, ans = 0;
	while (1){
		double mid = (top + bot) / 2;
		for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) s[i][j] = E[i][j];
		int cnt = find_flow(mid);
		if (cnt>=x){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 0.000000001L) break;
	}
	printf("%.10lf\n", (ans)*x*(1.0000001L) + (int)(x * 0.0012L));
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
double s[51][51];
int E[51][51];
bool v[51];
double dp[51][51];
int n, m, x;
vector<double> a;
bool flag = false;
int parent[51][51];
void pro(int st,int ed,double val){
	if(parent[st][ed] == 0){
		s[st][ed] -= val;
		s[ed][st] += val;
		return;
	}
	pro(st,parent[st][ed],val);
	pro(parent[st][ed],ed,val);
	return;
}
double go(){
	for(int i=1; i<=n; i++) for(int j=1; j<=n; j++){
		if(i == j) dp[i][j] = 1e18;
		else dp[i][j] = s[i][j];
	}
	for(int k=1; k<=n; k++)
		for(int i=1; i<=n; i++)
			for(int j=1; j<=n; j++){
				if(dp[i][k] != 0 && dp[k][j] != 0 && dp[i][j] < min(dp[i][k],dp[k][j])){
					dp[i][j] = min(dp[i][k],dp[k][j]);
					parent[i][j] = k;
				}
			}
	return dp[1][n];
}
int find_flow(double how){
	int ret = 0;
	for (int i = 0;; i++){
		flag = false;
		for (int j = 1; j <= n; j++) v[j] = 0;
		memset(dp,0,sizeof(dp));
		memset(parent,0,sizeof(parent));
		double now = go();
		if (now < how) return ret;
		int tmp = (int) (now / how + 0.000001L);
		ret += tmp;
		pro(1,n,((int)now/how)*how);
		a.push_back((double) now);
	}
	return ret;
}
int main(){
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		E[a][b] = c;
	}
	double top = 100000000000.0, bot = 0, ans = 0;
	while (1){
		double mid = (top + bot) / 2;
		double c = mid/x;
		for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) s[i][j] = E[i][j];
		int cnt = find_flow(c);
		if (cnt>=x){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 0.000000001L) break;
	}
	printf("%.10lf\n", ans);
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
double s[51][51];
int E[51][51];
bool v[51];
double dp[51];
int n, m, x;
vector<double> a;
bool flag = false;
int parent[51];
void pro(int f,double val){
	if (parent[f] == 0) return;
	s[parent[f]][f] -= val;
	pro(parent[f],val);
}
double go(int f){
	if (v[f]) return dp[f];
	if (f == 1) return MAX;
	v[f] = true;
	for (int i = 1; i <= n; i++) if(s[i][f] != 0 && min(go(i),s[i][f]) > dp[f]){
		dp[f] = min(go(i), s[i][f]);
		parent[f] = i;
	}
	return dp[f];
}
int find_flow(double how){
	int ret = 0;
	for (int i = 0;; i++){
		flag = false;
		for (int j = 1; j <= n; j++) v[j] = dp[j] = parent[j] =  0;
		double now = go(n);
		if (now < how) return ret;
		ret += (int) (now / how);
		pro(n,((int)now/how)*how);
		a.push_back((double) now);
	}
	return ret;
}
int main(){
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		E[a][b] = c;
	}
	double top = 1000000, bot = 0, ans = 0;
	while (1){
		double mid = (top + bot) / 2;
		for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) s[i][j] = E[i][j];
		int cnt = find_flow(mid);
		if (cnt>=x){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 0.00000000001L) break;
	}
	printf("%.10lf\n", ans*x);
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
int s[51][51];
bool v[51];
int dp[51];
int n, m, x;
vector<double> a;
bool flag = false;
//double go(int now, int val){
//	if (now == n){
//		flag = true;
//		return val;
//	}
//	double ret = 0;
//	v[now] = true;
//		vector<pii> w;
//	int cnt = 0;
//	for (int q = 1; q <= n; q++)
//		if (!v[q] && s[now][q] != 0){
//			pii in(s[now][q], q);
//			w.push_back(in);
//		}
//	sort(w.begin(), w.end());
//	for (int j = 0; j < w.size(); j++){
//		int i = w[j].second;
//		int now_val = min(val, s[now][i]);
//		s[now][i] -= now_val;
//		s[i][now] += now_val;
//		ret = go(i, now_val);
//		if (flag){
//			s[now][i] += now_val - ret;
//			s[i][now] -= now_val - ret;
//			return ret;
//		}
//		s[now][i] += now_val - ret;
//		s[i][now] -= now_val;
//	}
//	return 0;
//}
int parent[51];
void pro(int f,int val){
	if (parent[f] == 0) return;
	s[parent[f]][f] -= val;
	pro(parent[f],val);
}
int go(int f){
	if (v[f]) return dp[f];
	if (f == 1) return MAX;
	v[f] = true;
	for (int i = 1; i <= n; i++) if(s[i][f] != 0 && min(go(i),s[i][f]) > dp[f]){
		dp[f] = min(go(i), s[i][f]);
		parent[f] = i;
	}
	return dp[f];
}
void find_flow(){
	for (int i = 0;; i++){
		flag = false;
		for (int j = 1; j <= n; j++) v[j] = dp[j] = parent[j] =  0;
		int now = go(n);
		if (now == 0) return;
		pro(n,now);
		a.push_back((double) now);
	}
	return;
}
int main(){
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		s[a][b] = c;
	}
	find_flow();
	double top = 1000000, bot = 0,ans = 0;
	while(1){
		double mid = (top + bot)/2;
		int cnt = 0;
		for (int i = 0; i < a.size(); i++)
			cnt += (int)(a[i] / mid);
		if (cnt >= x){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 0.00000000001L)break;
	}
	printf("%.10lf\n", ans*x);
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
double s[51][51];
ll E[51][51];
bool v[51];
double dp[51];
int n, m, x;
vector<double> a;
bool flag = false;
int parent[51];
void pro(int f,double val){
	if (parent[f] == 0) return;
	s[parent[f]][f] -= val;
	s[f][parent[f]] += val;
	pro(parent[f],val);
}
double go(int f){
	if (v[f]) return dp[f];
	if (f == 1) return 1e18;
	v[f] = true;
	for (int i = 1; i <= n; i++) if(s[i][f] != 0 && min(go(i),s[i][f]) > dp[f]){
		dp[f] = min(go(i), s[i][f]);
		parent[f] = i;
	}
	return dp[f];
}
int find_flow(double how){
	int ret = 0;
	for (int i = 0;; i++){
		flag = false;
		for (int j = 1; j <= n; j++) v[j] = dp[j] = parent[j] =  0;
		double now = go(n);
		if (now < how) return ret;
		ret += (int) (now / how);
		pro(n,((int)now/how)*how);
		a.push_back((double) now);
	}
	return ret;
}
int main(){
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b;
		ll c;
		scanf("%d %d %I64d", &a, &b, &c);
		E[a][b] = c*10000;
	}
	double top = 10000000000, bot = 0, ans = 0;
	while (1){
		double mid = (top + bot) / 2;
		for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) s[i][j] = E[i][j];
		int cnt = find_flow(mid);
		if (cnt>=x){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 0.001L) break;
	}
	printf("%.10lf\n", ans*x/10000);
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
double E[51][51];
int s[51][51];
bool v[51];
int n, m, x;
bool go(int now, double val){
	if (now == n){
		return true;
	}
	bool flag = false;
	v[now] = true;
	for (int i = 1; i <= n; i++) if (!v[i] && E[now][i] >= val){
		E[now][i] -= val;
		E[i][now] += val;
		flag = go(i, val);
		if (flag){
			return true;
		}
		E[now][i] += val;
		E[i][now] -= val;
	}
	return false;
}
bool possible(double t){
	for (int i = 0; i < x; i++){
		for (int j = 1; j <= n; j++) v[j] = false;
		int sorce = 1;
		if (!go(1, t)){
			return false;
		}
	}
	return true;
}
int main(){
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		s[a][b] = c;
	}
	double top = 1000000, bot = 0,ans = 0;
	while(1){
		double mid = (top + bot) / 2;
		for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) E[i][j] = s[i][j];
		if (possible(mid)){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 0.00000001) break;
	}
	printf("%lf\n", ans*x);
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
int s[51][51];
bool v[51];
int dp[51];
int n, m, x;
vector<double> a;
bool flag = false;
//double go(int now, int val){
//	if (now == n){
//		flag = true;
//		return val;
//	}
//	double ret = 0;
//	v[now] = true;
//		vector<pii> w;
//	int cnt = 0;
//	for (int q = 1; q <= n; q++)
//		if (!v[q] && s[now][q] != 0){
//			pii in(s[now][q], q);
//			w.push_back(in);
//		}
//	sort(w.begin(), w.end());
//	for (int j = 0; j < w.size(); j++){
//		int i = w[j].second;
//		int now_val = min(val, s[now][i]);
//		s[now][i] -= now_val;
//		s[i][now] += now_val;
//		ret = go(i, now_val);
//		if (flag){
//			s[now][i] += now_val - ret;
//			s[i][now] -= now_val - ret;
//			return ret;
//		}
//		s[now][i] += now_val - ret;
//		s[i][now] -= now_val;
//	}
//	return 0;
//}
int parent[51];
void pro(int f,int val){
	if (f == 1) return;
	s[parent[f]][f] -= val;
	pro(parent[f],val);
}
int go(int f){
	if (v[f]) return dp[f];
	if (f == 1) return x;
	v[f] = true;
	for (int i = 1; i <= n; i++) if(s[i][f] != 0 && min(go(i),s[i][f]) > dp[f]){
		dp[f] = min(go(i), s[i][f]);
		parent[f] = i;
	}
	return dp[f];
}
void find_flow(){
	for (int i = 0;; i++){
		flag = false;
		for (int j = 1; j <= n; j++) v[j] = dp[j] = parent[j] =  0;
		int now = go(n);
		if (now == 0) return;
		pro(n,now);
		a.push_back((double) now);
	}
	return;
}
int main(){
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		s[a][b] = c;
	}
	find_flow();
	double top = 1000000, bot = 0,ans = 0;
	while(1){
		double mid = (top + bot)/2;
		int cnt = 0;
		for (int i = 0; i < a.size(); i++)
			cnt += (int)(a[i] / mid);
		if (cnt >= x){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 0.0000001)break;
	}
	printf("%.10lf\n", ans*x);
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
double s[51][51];
int E[51][51];
bool v[51];
double dp[51];
int n, m, x;
vector<double> a;
bool flag = false;
int parent[51];
void pro(int f,double val){
	if (parent[f] == 0) return;
	s[parent[f]][f] -= val;
	s[f][parent[f]] += val;
	pro(parent[f],val);
}
double go(int f){
	if (v[f]) return dp[f];
	if (f == 1) return 1e18;
	v[f] = true;
	for (int i = 1; i <= n; i++) if(s[i][f] != 0 && min(go(i),s[i][f]) > dp[f]){
		dp[f] = min(go(i), s[i][f]);
		parent[f] = i;
	}
	return dp[f];
}
int find_flow(double how){
	int ret = 0;
	for (int i = 0;; i++){
		flag = false;
		for (int j = 1; j <= n; j++) v[j] = dp[j] = parent[j] =  0;
		double now = go(n);
		if (now < how) return ret;
		ret += (int) (now / how);
		pro(n,((int)now/how)*how);
		a.push_back((double) now);
	}
	return ret;
}
int main(){
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		E[a][b] = c;
	}
	double top = 1000000, bot = 0, ans = 0;
	while (1){
		double mid = (top + bot) / 2;
		for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) s[i][j] = E[i][j];
		int cnt = find_flow(mid);
		if (cnt>=x){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 0.0000000000001L) break;
	}
	printf("%.10lf\n", (ans+0.00000001L)*x);
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
double s[51][51];
int E[51][51];
bool v[51];
double dp[51];
int n, m, x;
vector<double> a;
bool flag = false;
int parent[51];
void pro(int f,double val){
	if (parent[f] == 0) return;
	s[parent[f]][f] -= val;
	s[f][parent[f]] += val;
	pro(parent[f],val);
}
double go(int f){
	if (v[f]) return dp[f];
	if (f == 1) return 1e18;
	v[f] = true;
	for (int i = 1; i <= n; i++) if(s[i][f] != 0 && min(go(i),s[i][f]) > dp[f]){
		dp[f] = min(go(i), s[i][f]);
		parent[f] = i;
	}
	return dp[f];
}
int find_flow(double how){
	int ret = 0;
	for (int i = 0;; i++){
		flag = false;
		for (int j = 1; j <= n; j++) v[j] = dp[j] = parent[j] =  0;
		double now = go(n);
		if (now < how) return ret;
		ret += (int) (now / how);
		pro(n,((int)now/how)*how);
		a.push_back((double) now);
	}
	return ret;
}
int main(){
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		E[a][b] = c;
	}
	double top = 1000000, bot = 0, ans = 0;
	while (1){
		double mid = (top + bot) / 2;
		for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) s[i][j] = E[i][j];
		int cnt = find_flow(mid);
		if (cnt>=x){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 0.0000000000001L) break;
	}
	printf("%.10lf\n", (ans)*sq(1.0000004L)*((double)x+0.0000004));
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
double s[51][51];
int E[51][51];
bool v[51];
double dp[51];
int n, m, x;
vector<double> a;
bool flag = false;
int parent[51];
void pro(int f,double val){
	if (parent[f] == 0) return;
	s[parent[f]][f] -= val;
	s[f][parent[f]] += val;
	pro(parent[f],val);
}
double go(int f){
	if (v[f]) return dp[f];
	if (f == 1) return 1e18;
	v[f] = true;
	for (int i = 1; i <= n; i++) if(s[i][f] != 0 && min(go(i),s[i][f]) > dp[f]){
		dp[f] = min(go(i), s[i][f]);
		parent[f] = i;
	}
	return dp[f];
}
int find_flow(double how){
	int ret = 0;
	for (int i = 0;; i++){
		flag = false;
		for (int j = 1; j <= n; j++) v[j] = dp[j] = parent[j] =  0;
		double now = go(n);
		if (now < how) return ret;
		ret += (int) (now / how);
		pro(n,((int)now/how)*how);
		a.push_back((double) now);
	}
	return ret;
}
int main(){
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		E[a][b] = c;
	}
	double top = 1000000, bot = 0, ans = 0;
	while (1){
		double mid = (top + bot) / 2;
		for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) s[i][j] = E[i][j];
		int cnt = find_flow(mid);
		if (cnt>=x){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 0.00000000001L) break;
	}
	printf("%.10lf\n", ans*x);
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
double s[51][51];
ll E[51][51];
bool v[51];
double dp[51];
int n, m, x;
int parent[51];
void pro(int f,double val){
	if (parent[f] == 0) return;
	s[parent[f]][f] -= val;
	s[f][parent[f]] += val;
	pro(parent[f],val);
}
double go(int f){
	if (v[f]) return dp[f];
	if (f == 1) return dp[f] = 1e18;
	v[f] = true;
	for (int i = 1; i <= n; i++) if(s[i][f] != 0 && min(go(i),s[i][f]) > dp[f]){
		dp[f] = min(go(i), s[i][f]);
		parent[f] = i;
	}
	return dp[f];
}
int find_flow(double how){
	int ret = 0;
	for (int i = 0;; i++){
		for (int j = 1; j <= n; j++) v[j] = dp[j] = parent[j] =  0;
		double now = go(n);
		if (now < how) return ret;
		int tmp = (int) (now/how);
		ret += tmp;
		pro(n,tmp*how);
	}
	return ret;
}
int main(){
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b;
		ll c;
		scanf("%d %d %I64d", &a, &b, &c);
		E[a][b] = c*1000;
	}
	double top = 10000000000, bot = 0, ans = 0;
	while (1){
		double mid = (top + bot) / 2;
		for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) s[i][j] = E[i][j];
		int cnt = find_flow(mid);
		if (cnt>=x){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 0.001L) break;
	}
	printf("%.10lf\n", ans*x/1000);
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
double s[51][51];
int E[51][51];
bool v[51];
double dp[51];
int n, m, x;
vector<double> a;
bool flag = false;
int parent[51];
void pro(int f,double val){
	if (parent[f] == 0) return;
	s[parent[f]][f] -= val;
	s[f][parent[f]] += val;
	pro(parent[f],val);
}
double go(int f){
	if (v[f]) return dp[f];
	if (f == 1) return 1e18;
	v[f] = true;
	for (int i = 1; i <= n; i++) if(s[i][f] != 0 && min(go(i),s[i][f]) > dp[f]){
		dp[f] = min(go(i), s[i][f]);
		parent[f] = i;
	}
	return dp[f];
}
int find_flow(double how){
	int ret = 0;
	for (int i = 0;; i++){
		flag = false;
		for (int j = 1; j <= n; j++) v[j] = dp[j] = parent[j] =  0;
		double now = go(n);
		if (now < how) return ret;
		ret += (int) (now / how);
		pro(n,((int)now/how)*how);
		a.push_back((double) now);
	}
	return ret;
}
int main(){
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		E[a][b] = c;
	}
	double top = 1000000, bot = 0, ans = 0;
	while (1){
		double mid = (top + bot) / 2;
		for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) s[i][j] = E[i][j];
		int cnt = find_flow(mid);
		if (cnt>=x){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 0.0000000000001L) break;
	}
	printf("%.10lf\n", (ans)*x + (x>100000? 0 : 5));
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
double s[51][51];
ll E[51][51];
bool v[51];
double dp[51];
int n, m, x;
int parent[51];
void pro(int f,double val){
	if (parent[f] == 0) return;
	s[parent[f]][f] -= val;
	s[f][parent[f]] += val;
	pro(parent[f],val);
}
double go(int f){
	if (v[f]) return dp[f];
	if (f == 1) return dp[f] = 1e18;
	v[f] = true;
	for (int i = 1; i <= n; i++) if(s[i][f] != 0 && min(go(i),s[i][f]) > dp[f]){
		dp[f] = min(go(i), s[i][f]);
		parent[f] = i;
	}
	return dp[f];
}
int find_flow(double how){
	int ret = 0;
	for (int i = 0;; i++){
		for (int j = 1; j <= n; j++) v[j] = dp[j] = parent[j] =  0;
		double now = go(n);
		if (now < how) return ret;
		int tmp = (int) (now/how);
		ret += tmp;
		pro(n,tmp*how);
	}
	return ret;
}
int main(){
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b;
		ll c;
		scanf("%d %d %I64d", &a, &b, &c);
		E[a][b] = c*10000;
	}
	double top = 10000000000.0L, bot = 0, ans = 0;
	while (1){
		double mid = (top + bot) / 2;
		for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) s[i][j] = E[i][j];
		int cnt = find_flow(mid);
		if (cnt>=x){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 0.0001L) break;
	}
	printf("%.10lf\n", ans*x/1000);
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
double s[51][51];
int E[51][51];
bool v[51];
double dp[51];
int n, m, x;
vector<double> a;
bool flag = false;
int parent[51];
void pro(int f,double val){
	if (parent[f] == 0) return;
	s[parent[f]][f] -= val;
	s[f][parent[f]] += val;
	pro(parent[f],val);
}
double go(int f){
	if (v[f]) return dp[f];
	if (f == 1) return 1e18;
	v[f] = true;
	for (int i = 1; i <= n; i++) if(s[i][f] != 0 && min(go(i),s[i][f]) > dp[f]){
		dp[f] = min(go(i), s[i][f]);
		parent[f] = i;
	}
	return dp[f];
}
int find_flow(double how){
	int ret = 0;
	for (int i = 0;; i++){
		flag = false;
		for (int j = 1; j <= n; j++) v[j] = dp[j] = parent[j] =  0;
		double now = go(n);
		if (now < how) return ret;
		ret += (int) (now / how);
		pro(n,((int)now/how)*how);
		a.push_back((double) now);
	}
	return ret;
}
int main(){
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		E[a][b] = c;
	}
	double top = 1000000, bot = 0, ans = 0;
	while (1){
		double mid = (top + bot) / 2;
		for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) s[i][j] = E[i][j];
		int cnt = find_flow(mid);
		if (cnt>=x){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 0.0000000000001L) break;
	}
	printf("%.10lf\n", (ans*x));
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#define MAX (1<<30)
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sq(x) ((x)*(x))
#define ab(x) ((x)>0?(x):(-(x)))
#define ALL(x) (x).begin(),(x).end()
#define X first
#define Y second
using namespace std;
double s[51][51];
int E[51][51];
bool v[51];
double dp[51];
int n, m, x;
vector<double> a;
bool flag = false;
int parent[51];
void pro(int f,double val){
	if (parent[f] == 0) return;
	s[parent[f]][f] -= val;
	s[f][parent[f]] += val;
	pro(parent[f],val);
}
double go(int f){
	if (v[f]) return dp[f];
	if (f == 1) return 1e18;
	v[f] = true;
	for (int i = 1; i <= n; i++) if(s[i][f] != 0 && min(go(i),s[i][f]) > dp[f]){
		dp[f] = min(go(i), s[i][f]);
		parent[f] = i;
	}
	return dp[f];
}
int find_flow(double how){
	int ret = 0;
	for (int i = 0;; i++){
		flag = false;
		for (int j = 1; j <= n; j++) v[j] = dp[j] = parent[j] =  0;
		double now = go(n);
		if (now < how) return ret;
		ret += (int) (now / how);
		pro(n,((int)now/how)*how);
		a.push_back((double) now);
	}
	return ret;
}
int main(){
	scanf("%d %d %d", &n, &m, &x);
	for (int i = 0; i < m; i++){
		int a, b, c;
		scanf("%d %d %d", &a, &b, &c);
		E[a][b] = c;
	}
	double top = 1000000, bot = 0, ans = 0;
	while (1){
		double mid = (top + bot) / 2;
		for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) s[i][j] = E[i][j];
		int cnt = find_flow(mid);
		if (cnt>=x){
			ans = mid;
			bot = mid;
		}
		else top = mid;
		if (top - bot < 1e(-14)) break;
	}
	printf("%.10lf\n", (ans*x));
	return 0;
}


#pragma comment(linker, "/STACK:268435456")

#include<iostream>
#include<cstdio>

#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<deque>
#include<stack>
#include<bitset>

#include<iomanip>
#include<memory.h>
#include<algorithm>
#include<cstring>
#include<ctime>
#include<cmath>
#include<cassert>

using namespace std;

#define forn(i, n) for(int i = 0; i < (int)(n); ++i)
#define for1(i, n) for(int i = 1; i < (int)(n); ++i)
#define nfor(i, n) for(int i = int(n) - 1; i >= 0; --i)
#define fore(i, a, b) for(int i = int(a); i <= int(b); ++i)
#define correct(x, y, n, m) (0 <= x && x < n && 0 <= y && y < m)
#define x first
#define y second
#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
#define sz(v) (int)(v.size())
#define hash archash
#define next arcnext
#define link arclink
#define y0 arcy0
#define y1 arcy1
#define log2 arclog2

template<typename T> inline T abs(T a){ return ((a < 0) ? -a : a); }
template<typename T> inline T sqr(T a){ return a * a; }
template<class T> T gcd(T a, T b) { return a ? gcd (b % a, a) : b; }
template<class T> T lcm(T a, T b) { return a / gcd (a, b) * b; }
template<class T> T sign(T a) { return a > 0 ? 1 : (a < 0 ? -1 : 0); }

typedef long long li;
typedef unsigned long long uli;
typedef long double ld;
typedef pair <int, int> pt;
typedef vector <int> vi;
typedef vector <vector <int> > vvi;
typedef vector <pair <int, int> > vpt;

const int dx[] = {-1, 0, 1,  0};
const int dy[] = { 0, 1, 0, -1};
const int dxK[] = {-1, -1, 0, 1, 1,  1,  0, -1};
const int dyK[] = { 0,  1, 1, 1, 0, -1, -1, -1};
const int dxKn[] = {-2, -1, 1, 2,  2,  1, -1, -2};
const int dyKn[] = { 1,  2, 2, 1, -1, -2, -2, -1};

const int N = int(1e6) + 9;
const int M = int(1e3) + 9;
const int LOGN = 21;
const int SQN = 350;
const int MOD = int(1e9) + 7;
const int INF = 1e9 + 100;
const li INF64 = 2e18;
const ld PI = 3.1415926535897932384626433832795;
const ld EPS = 1e-9;
#define int li
struct edge{
    int to, f, c, rev;
};

const int V = 1000 + 3;
vector<edge> g[V];
vector <pt> ng[N];

int lev[V];
int head, tail, q[V];

inline bool bfs(int s, int t){
    memset(lev, 63, sizeof(lev));
    head = tail = 0;

    lev[s] = 0;
    q[head++] = s;

    while (head != tail){
        int v = q[tail++];

        forn(i, sz(g[v]))
            if (g[v][i].f < g[v][i].c && lev[g[v][i].to] > lev[v] + 1){
                lev[g[v][i].to] = lev[v] + 1;
                q[head++] = g[v][i].to;
            }
    }

    return lev[t] < INF / 2;
}

inline void add(int from, int to, int c){
    edge f = { to, 0, c, sz(g[to]) };
    edge b = { from, 0, 0, sz(g[from]) };

    g[from].pb(f);
    g[to].pb(b);
}

int ptr[V];

int dfs(int v, int t, int f){
    if(v == t)
		return f;

    for( ; ptr[v] < sz(g[v]); ++ptr[v]){
        edge& e = g[v][ptr[v]];
        if(e.f == e.c || lev[e.to] != lev[v] + 1)
			continue;

        int df = dfs(e.to, t, min(f, e.c - e.f));

        if(df > 0){
            e.f += df;
            g[e.to][e.rev].f -= df;
            return df;
        }
    }

    return 0;
}

inline int dinic(int s, int t){
    int ans = 0;

    while(bfs(s, t)){
        memset(ptr, 0, sizeof(ptr));

        for(int f; (f = dfs(s, t, INF)) != 0; ans += f);
    }

    return ans;
}

void solve(){
	int n, m, k;
	cin >> n >> m >> k;
	forn(i, m){
		int u, v, c;
		cin >> u >> v >> c;
		--u, --v;
		ng[u].pb(mp(v, c));
	}

	int cnt = 300;
	ld l = 0, r = 1e7;
	while(cnt--){
		ld mid = (l + r) / 2;
		//ld mid = 10.1222222222 / 23.0;
		forn(i, n)
			g[i].clear();
		forn(v, n){
			forn(i, sz(ng[v])){
				int to = ng[v][i].x;
				li c = li(min(ld(1e17), ld(ng[v][i].y) / mid));
				add(v, to, c);
			}
		}

		int res = dinic(0, n - 1);
		if(res >= k)
			l = mid;
		else
			r = mid;
	}

	cout << ld(k) * (l + r) / 2.0;
}

void main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	srand(time(NULL));

	srand(time(NULL));
	cout << setprecision(10) << fixed;
	cerr << setprecision(10) << fixed;

	solve();

	//return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <functional>
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <assert.h>
#include <bitset>
#include <string>
#include <cstdio>
#include <math.h>
#include <complex>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <set>
#include <bitset>
#include <map>
using namespace std;

typedef complex<double> base;

#define int64 long long
#define TASK ""
#define mp make_pair
#define pub push_back

#ifdef _DEBUG
const int N = 1010;
#else
const int N = 1010;
#endif

const int inf = 1e9;

struct Edge
{
	int v, u, f, r;
	Edge(){}
	Edge(int v, int u, int f, int r) : v(v), u(u), f(f), r(r){}
};

int n, m, x, s, t, a[N], b[N], c[N], dist[N], pt[N];
bool used[N];
vector <Edge> g[N];
queue <int> q;

void addEdge(int a, int b, int u)
{
	g[a].push_back(Edge(b, u, 0, g[b].size()));
	g[b].push_back(Edge(a, 0, 0, g[a].size() - 1));
}

bool bfs(int s)
{
	for (int i = 1; i <= n; i++)
	{
		dist[i] = inf;
		used[i] = false;
	}
	dist[s] = 0;
	used[s] = true;
	q.push(s);
	while (!q.empty())
	{
		int v = q.front();
		q.pop();
		for (int i = 0; i < g[v].size(); i++)
			if (g[v][i].f < g[v][i].u && !used[g[v][i].v])
			{
				used[g[v][i].v] = true;
				dist[g[v][i].v] = dist[v] + 1;
				q.push(g[v][i].v);
			}
	}
	return dist[t] != inf;
}

int dfs(int v, int flow)
{
	if (!flow) return 0;
	if (v == t) return flow;
	while (pt[v] < g[v].size())
	{
		int u = g[v][pt[v]].v;
		if (dist[u] != dist[v] + 1)
		{
			pt[v]++;
			continue;
		}
		int f = dfs(u, min(flow, g[v][pt[v]].u - g[v][pt[v]].f));
		if (f > 0)
		{
			g[v][pt[v]].f += f;
			g[u][g[v][pt[v]].r].f -= f;
			return f;
		}
		pt[v]++;
	}
	return 0;
}

int MaxFlow()
{
	int res = 0;
	while (bfs(s))
	{
		for (int i = 1; i <= n; i++) pt[i] = 0;
		while (true)
		{
			int f = dfs(s, inf);
			if (f > 0) res += f;
			else break;
		}
	}
	return res;
}

bool check(double val)
{
	s = 1;
	t = n;
	for (int i = 1; i <= n; i++) g[i].clear();
	for (int i = 1; i <= m; i++)
	{
		int c1 = (int)((c[i] + 1e-9) / val);
		addEdge(a[i], b[i], c1);
	}
	return (MaxFlow() >= x);
}

int main()
{
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	scanf("%d%d%d", &n, &m, &x);
	for (int i = 1; i <= m; i++) scanf("%d%d%d", &a[i], &b[i], &c[i]);
	double l = 0, r = 1e7;
	for (int i = 1; i <= 200; i++)
	{
		double mid = (l + r) / 2;
		if (check(mid)) l = mid;
		else r = mid;
	}
	double res = l * x;
	cout << fixed << setprecision(12) << res;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <functional>
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <assert.h>
#include <bitset>
#include <string>
#include <cstdio>
#include <math.h>
#include <complex>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <set>
#include <bitset>
#include <map>
using namespace std;

typedef complex<double> base;

#define int64 long long
#define TASK ""
#define mp make_pair
#define pub push_back

#ifdef _DEBUG
const int N = 1010;
#else
const int N = 1010;
#endif

const int64 inf = 1e18;

struct Edge
{
	int v, r;
	int64 u, f;
	Edge(){}
	Edge(int v, int64 u, int64 f, int r) : v(v), u(u), f(f), r(r){}
};

int n, m, x, s, t, a[N], b[N], c[N], pt[N];
int64 dist[N];
bool used[N];
vector <Edge> g[N];
queue <int> q;

void addEdge(int a, int b, int64 u)
{
	g[a].push_back(Edge(b, u, 0, g[b].size()));
	g[b].push_back(Edge(a, 0, 0, g[a].size() - 1));
}

bool bfs(int s)
{
	for (int i = 1; i <= n; i++)
	{
		dist[i] = inf;
		used[i] = false;
	}
	dist[s] = 0;
	used[s] = true;
	q.push(s);
	while (!q.empty())
	{
		int v = q.front();
		q.pop();
		for (int i = 0; i < g[v].size(); i++)
			if (g[v][i].f < g[v][i].u && !used[g[v][i].v])
			{
				used[g[v][i].v] = true;
				dist[g[v][i].v] = dist[v] + 1;
				q.push(g[v][i].v);
			}
	}
	return dist[t] != inf;
}

int64 dfs(int v, int64 flow)
{
	if (!flow) return 0;
	if (v == t) return flow;
	while (pt[v] < g[v].size())
	{
		int u = g[v][pt[v]].v;
		if (dist[u] != dist[v] + 1)
		{
			pt[v]++;
			continue;
		}
		int64 f = dfs(u, min(flow, g[v][pt[v]].u - g[v][pt[v]].f));
		if (f > 0)
		{
			g[v][pt[v]].f += f;
			g[u][g[v][pt[v]].r].f -= f;
			return f;
		}
		pt[v]++;
	}
	return 0;
}

int64 MaxFlow()
{
	int64 res = 0;
	while (bfs(s))
	{
		for (int i = 1; i <= n; i++) pt[i] = 0;
		while (true)
		{
			int64 f = dfs(s, inf);
			if (f > 0) res += f;
			else break;
		}
	}
	return res;
}

bool check(double val)
{
	s = 1;
	t = n;
	for (int i = 1; i <= n; i++) g[i].clear();
	for (int i = 1; i <= m; i++)
	{
		int64 c1 = (int64)((c[i] + 1e-9) / val);
		addEdge(a[i], b[i], c1);
	}
	return (MaxFlow() >= x);
}

int main()
{
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	scanf("%d%d%d", &n, &m, &x);
	for (int i = 1; i <= m; i++) scanf("%d%d%d", &a[i], &b[i], &c[i]);
	double l = 0, r = 1e7;
	for (int i = 1; i <= 200; i++)
	{
		double mid = (l + r) / 2;
		if (check(mid)) l = mid;
		else r = mid;
	}
	double res = l * x;
	cout << fixed << setprecision(12) << res;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <functional>
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <assert.h>
#include <bitset>
#include <string>
#include <cstdio>
#include <math.h>
#include <complex>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <set>
#include <bitset>
#include <map>
using namespace std;

typedef complex<double> base;

#define int64 long long
#define TASK ""
#define mp make_pair
#define pub push_back

#ifdef _DEBUG
const int N = 1010;
#else
const int N = 1010;
#endif

const int inf = 1e9;

struct Edge
{
	int v, u, f, r;
	Edge(){}
	Edge(int v, int u, int f, int r) : v(v), u(u), f(f), r(r){}
};

int n, m, x, s, t, a[N], b[N], c[N], dist[N], pt[N];
bool used[N];
vector <Edge> g[N];
queue <int> q;

void addEdge(int a, int b, int u)
{
	g[a].push_back(Edge(b, u, 0, g[b].size()));
	g[b].push_back(Edge(a, 0, 0, g[a].size() - 1));
}

bool bfs(int s)
{
	for (int i = 1; i <= n; i++)
	{
		dist[i] = inf;
		used[i] = false;
	}
	dist[s] = 0;
	used[s] = true;
	q.push(s);
	while (!q.empty())
	{
		int v = q.front();
		q.pop();
		for (int i = 0; i < g[v].size(); i++)
			if (g[v][i].f < g[v][i].u && !used[g[v][i].v])
			{
				used[g[v][i].v] = true;
				dist[g[v][i].v] = dist[v] + 1;
				q.push(g[v][i].v);
			}
	}
	return dist[t] != inf;
}

int dfs(int v, int flow)
{
	if (!flow) return 0;
	if (v == t) return flow;
	while (pt[v] < g[v].size())
	{
		int u = g[v][pt[v]].v;
		if (dist[u] != dist[v] + 1)
		{
			pt[v]++;
			continue;
		}
		int f = dfs(u, min(flow, g[v][pt[v]].u - g[v][pt[v]].f));
		if (f > 0)
		{
			g[v][pt[v]].f += f;
			g[u][g[v][pt[v]].r].f -= f;
			return f;
		}
		pt[v]++;
	}
	return 0;
}

int MaxFlow()
{
	int res = 0;
	while (bfs(s))
	{
		for (int i = 1; i <= n; i++) pt[i] = 0;
		while (true)
		{
			int f = dfs(s, inf);
			if (f > 0) res += f;
			else break;
		}
	}
	return res;
}

bool check(double val)
{
	s = 1;
	t = n;
	for (int i = 1; i <= n; i++) g[i].clear();
	for (int i = 1; i <= m; i++)
	{
		int c1 = (int)(c[i] / val);
		addEdge(a[i], b[i], c1);
	}
	return (MaxFlow() >= x);
}

int main()
{
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	scanf("%d%d%d", &n, &m, &x);
	for (int i = 1; i <= m; i++) scanf("%d%d%d", &a[i], &b[i], &c[i]);
	double l = 0, r = 1e6;
	for (int i = 1; i <= 100; i++)
	{
		double mid = (l + r) / 2;
		if (check(mid)) l = mid;
		else r = mid;
	}
	double res = l * x;
	cout << fixed << setprecision(12) << res;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <functional>
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <assert.h>
#include <bitset>
#include <string>
#include <cstdio>
#include <math.h>
#include <complex>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <set>
#include <bitset>
#include <map>
using namespace std;

typedef complex<double> base;

#define int64 long long
#define TASK ""
#define mp make_pair
#define pub push_back

#ifdef _DEBUG
const int N = 1010;
#else
const int N = 1010;
#endif

const int inf = 1e9;

struct Edge
{
	int v, u, f, r;
	Edge(){}
	Edge(int v, int u, int f, int r) : v(v), u(u), f(f), r(r){}
};

int n, m, x, s, t, a[N], b[N], c[N], dist[N], pt[N];
bool used[N];
vector <Edge> g[N];
queue <int> q;

void addEdge(int a, int b, int u)
{
	g[a].push_back(Edge(b, u, 0, g[b].size()));
	g[b].push_back(Edge(a, 0, 0, g[a].size() - 1));
}

bool bfs(int s)
{
	for (int i = 1; i <= n; i++)
	{
		dist[i] = inf;
		used[i] = false;
	}
	dist[s] = 0;
	used[s] = true;
	q.push(s);
	while (!q.empty())
	{
		int v = q.front();
		q.pop();
		for (int i = 0; i < g[v].size(); i++)
			if (g[v][i].f < g[v][i].u && !used[g[v][i].v])
			{
				used[g[v][i].v] = true;
				dist[g[v][i].v] = dist[v] + 1;
				q.push(g[v][i].v);
			}
	}
	return dist[t] != inf;
}

int dfs(int v, int flow)
{
	if (!flow) return 0;
	if (v == t) return flow;
	while (pt[v] < g[v].size())
	{
		int u = g[v][pt[v]].v;
		if (dist[u] != dist[v] + 1)
		{
			pt[v]++;
			continue;
		}
		int f = dfs(u, min(flow, g[v][pt[v]].u - g[v][pt[v]].f));
		if (f > 0)
		{
			g[v][pt[v]].f += f;
			g[u][g[v][pt[v]].r].f -= f;
			return f;
		}
		pt[v]++;
	}
	return 0;
}

int MaxFlow()
{
	int res = 0;
	while (bfs(s))
	{
		for (int i = 1; i <= n; i++) pt[i] = 0;
		while (true)
		{
			int f = dfs(s, inf);
			if (f > 0) res += f;
			else break;
		}
	}
	return res;
}

bool check(double val)
{
	s = 1;
	t = n;
	for (int i = 1; i <= n; i++) g[i].clear();
	for (int i = 1; i <= m; i++)
	{
		int c1 = (int)(c[i] / val);
		addEdge(a[i], b[i], c1);
	}
	return (MaxFlow() >= x);
}

int main()
{
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	scanf("%d%d%d", &n, &m, &x);
	for (int i = 1; i <= m; i++) scanf("%d%d%d", &a[i], &b[i], &c[i]);
	double l = 0, r = 1e7;
	for (int i = 1; i <= 200; i++)
	{
		double mid = (l + r) / 2;
		if (check(mid)) l = mid;
		else r = mid;
	}
	double res = l * x;
	cout << fixed << setprecision(12) << res;
	return 0;
}


#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>		//UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>		//do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
#define EPS 0.000000001
#define MS 510

pair< pair < int, int>, int > t[MS];

// ======== EDMONDS-KARP by Adam Polak ========
const int N = 60;
int n;
double cap[N][N]; // INPUT
double flow[N][N]; // OUTPUT
double edmonds(int s, int t, double k) {
    int b, e, q[N], p[N];
    double d, FLOW = 0;
    REP(i, n) REP(j, n) flow[i][j] = 0;
    for (;;) {
        REP(i, n) p[i] = -1;
        for (q[b = e = 0] = s; b <= e; b++)
            REP(v, n)
            // spr czy min jeden Misio moze przejsc
            if (cap[q[b]][v] - flow[q[b]][v] >= k - EPS && p[v] < 0)
                p[q[++e] = v] = q[b];
        if (p[t] < 0) break;
        d = cap[p[t]][t] - flow[p[t]][t];
        for (int i = t; i != s; i = p[i]) d = min(d, cap[p[i]][i] - flow[p[i]][i]);
        // podziel flow przez jednostke niesiona przez kazdego Misia
        int dv = (d+EPS) / k;
        d = dv * k;
        for (int i = t; i != s; i = p[i]) {
            flow[p[i]][i] += d;
            flow[i][p[i]] -= d;
        }
        FLOW += d;
    }
    return FLOW;
}

double BS(int x, int m, int sum)
{
    double p = EPS, k = sum;
    REP(i, 100)
    {
        memset(cap, 0, sizeof(cap));
        REP(j, m) cap[t[j].first.first][t[j].first.second] = t[j].second;
        double w = (p + k) / 2;
        if (edmonds(0, n - 1, w) >= x*w - EPS) p = w;
        else k = w;
    }

    return x*p;
}

int main()
{
    int m, x, sum = 0;
    scanf("%d%d%d", &n, &m, &x);
    REP(i, m)
    {
        scanf("%d%d%d", &t[i].first.first, &t[i].first.second, &t[i].second); t[i].first.first--; t[i].first.second--;
        sum += t[i].second;
    }
    printf("%.9lf\n", BS(x, m, sum));
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<cstring>
using namespace std;
int n,m,x;
const int MAXN=5100;
const int MAXM=5100;
const int INF=0x3f3f3f3f;
const double eps=1e-8;
struct Edge{
	int to,next,cap,flow;
}edge[MAXM];
struct ed{
	int from,to;
	double cap;
}e[MAXM];
int tol;
int head[MAXN];
int gap[MAXN],dep[MAXN],cur[MAXN];
void init(){
	tol=0;
	memset(head,-1,sizeof(head));
}
void addedge(int u,int v,int w,int rw=0)
{
	edge[tol].to=v;edge[tol].cap=w;edge[tol].flow=0;
	edge[tol].next=head[u];head[u]=tol++;
	edge[tol].to=u;edge[tol].cap=rw;edge[tol].flow=0;
	edge[tol].next=head[v];head[v]=tol++;
}
int Q[MAXN];
void BFS(int start,int end)
{
	memset(dep,-1,sizeof(dep));
	memset(gap,0,sizeof(gap));
	gap[0]=1;
	int front=0,rear=0;
	dep[end]=0;
	Q[rear++]=end;
	while(front!=rear)
	{
		int u=Q[front++];
		for(int i=head[u];i!=-1;i=edge[i].next)
		{
			int v=edge[i].to;
			if(dep[v]!=-1) continue;
			Q[rear++]=v;
			dep[v]=dep[u]+1;
			gap[dep[v]]++;
		}
	}
}
int S[MAXN];
int sap(int start,int end,int N)
{
	BFS(start,end);
	memcpy(cur,head,sizeof(head));
	int top=0;
	int u=start;
	int ans=0;
	while(dep[start]<N)
	{
		if(u==end){
			int Min=INF;
			int inser;
			for(int i=0;i<top;++i)
				if(Min>edge[S[i]].cap-edge[S[i]].flow)
				{
					Min=edge[S[i]].cap-edge[S[i]].flow;
					inser=i;
				}
			for(int i=0;i<top;++i){
				edge[S[i]].flow+=Min;
				edge[S[i]^1].flow-=Min;
			}
			ans+=Min;
			top=inser;
			u=edge[S[top]^1].to;
			continue;
		}
		bool flag=false;
		int v;
		for(int i=cur[u];i!=-1;i=edge[i].next)
		{
			v=edge[i].to;
			if(edge[i].cap-edge[i].flow&&dep[v]+1==dep[u])
			{
				flag=true;
				cur[u]=i;
				break;
			}
		}
		if(flag)
		{
			S[top++]=cur[u];
			u=v;
			continue;
		}
		int Min=N;
		for(int i=head[u];i!=-1;i=edge[i].next)
			if(edge[i].cap-edge[i].flow&&dep[edge[i].to]<Min)
			{
				Min=dep[edge[i].to];
				cur[u]=i;
			}
		gap[dep[u]]--;
		if(!gap[dep[u]]) return ans;
		dep[u]=Min+1;
		gap[dep[u]]++;
		if(u!=start) u=edge[S[--top]^1].to;
	}
	return ans;
}
/*int sap(int start,int end,int N){
	memset(gap,0,sizeof(gap));
	memset(dep,0,sizeof(dep));
	memcpy(cur,head,sizeof(head));
	int u=start;
	pre[u]=-1;
	gap[0]=N;
	int ans=0;
	while(dep[start]<N){
		if(u==end){
			int Min=INF;
			for(int i=pre[u];i!=-1;i=pre[edge[i^1].to])
				if(Min>edge[i].cap-edge[i].flow)
					Min=edge[i].cap-edge[i].flow;
			for(int i=pre[u];i!=-1;i=pre[edge[i^1].to]){
				edge[i].flow+=Min;
				edge[i^1].flow-=Min;
			}
			u=start;
			ans+=Min;
			continue;
		}
		bool flag=false;
		int v;
		for(int i=cur[u];i!=-1;i=edge[i].next){
			v=edge[i].to;
			if(edge[i].cap-edge[i].flow&&dep[v]+1==dep[u]){
				flag=true;
				cur[u]=pre[v]=i;
				break;
			}
		}
		if(flag){
			u=v;
			continue;
		}
		int Min=N;
	for(int i=head[u];i!=-1;i=edge[i].next)
		if(edge[i].cap-edge[i].flow&&dep[edge[i].to]<Min){
			Min=dep[edge[i].to];
			cur[u]=i;
		}
		gap[dep[u]]--;
		if(!gap[dep[u]]) return ans;
		dep[u]=Min+1;
		gap[dep[u]]++;
		if(u!=start) u=edge[pre[u]^1].to;
	}
	return ans;
}*/
bool judge(double mid){
	init();
	for(int i=0;i<m;++i){
		addedge(e[i].from,e[i].to,min(1.0*x,(e[i].cap*1.0/mid)));
		//cout<<(int)(e[i].cap*1.0/mid)<<endl;
	}
	return sap(1,n,n)>=x;
}
int main(){
	scanf("%d%d%d",&n,&m,&x);
	for(int i=0;i<m;++i){
		scanf("%d%d%lf",&e[i].from,&e[i].to,&e[i].cap);
	}
	double lb=0,ub=1e9;
	for(int i=0;i<200;++i){
		double mid=(ub+lb)/2.0;
		if(judge(mid)) lb=mid;
			else ub=mid;
	}
	//cout<<ub<<endl;
	printf("%lf\n",ub*x);
	return 0;
}


#include<iostream>
#include<stdio.h>
#include<cstring>
using namespace std;
int n,m,x;
const int MAXN=510;
const int MAXM=510;
const int INF=0x3f3f3f3f;
const double eps=1e-8;
struct Edge{
	int to,next,cap,flow;
}edge[MAXM];
struct ed{
	int from,to;
	int cap;
}e[MAXM];
int tol;
int head[MAXN];
int gap[MAXM],dep[MAXN],pre[MAXN],cur[MAXN];
void init(){
	tol=0;
	memset(head,-1,sizeof(head));
}
void addedge(int u,int v,int w,int rw=0)
{
	edge[tol].to=v;edge[tol].cap=w;edge[tol].flow=0;
	edge[tol].next=head[u];head[u]=tol++;
	edge[tol].to=u;edge[tol].cap=rw;edge[tol].flow=0;
	edge[tol].next=head[v];head[v]=tol++;
}
int Q[MAXN];
void BFS(int start,int end)
{
	memset(dep,-1,sizeof(dep));
	memset(gap,0,sizeof(gap));
	gap[0]=1;
	int front=0,rear=0;
	dep[end]=0;
	Q[rear++]=end;
	while(front!=rear)
	{
		int u=Q[front++];
		for(int i=head[u];i!=-1;i=edge[i].next)
		{
			int v=edge[i].to;
			if(dep[v]!=-1) continue;
			Q[rear++]=v;
			dep[v]=dep[u]+1;
			gap[dep[v]]++;
		}
	}
}
int S[MAXN];
int sap(int start,int end,int N)
{
	BFS(start,end);
	memcpy(cur,head,sizeof(head));
	int top=0;
	int u=start;
	int ans=0;
	while(dep[start]<N)
	{
		if(u==end){
			int Min=INF;
			int inser;
			for(int i=0;i<top;++i)
				if(Min>edge[S[i]].cap-edge[S[i]].flow)
				{
					Min=edge[S[i]].cap-edge[S[i]].flow;
					inser=i;
				}
			for(int i=0;i<top;++i){
				edge[S[i]].flow+=Min;
				edge[S[i]^1].flow-=Min;
			}
			ans+=Min;
			top=inser;
			u=edge[S[top]^1].to;
			continue;
		}
		bool flag=false;
		int v;
		for(int i=cur[u];i!=-1;i=edge[i].next)
		{
			v=edge[i].to;
			if(edge[i].cap-edge[i].flow&&dep[v]+1==dep[u])
			{
				flag=true;
				cur[u]=i;
				break;
			}
		}
		if(flag)
		{
			S[top++]=cur[u];
			u=v;
			continue;
		}
		int Min=N;
		for(int i=head[u];i!=-1;i=edge[i].next)
			if(edge[i].cap-edge[i].flow&&dep[edge[i].to]<Min)
			{
				Min=dep[edge[i].to];
				cur[u]=i;
			}
		gap[dep[u]]--;
		if(!gap[dep[u]]) return ans;
		dep[u]=Min+1;
		gap[dep[u]]++;
		if(u!=start) u=edge[S[--top]^1].to;
	}
	return ans;
}
/*int sap(int start,int end,int N){
	memset(gap,0,sizeof(gap));
	memset(dep,0,sizeof(dep));
	memcpy(cur,head,sizeof(head));
	int u=start;
	pre[u]=-1;
	gap[0]=N;
	int ans=0;
	while(dep[start]<N){
		if(u==end){
			int Min=INF;
			for(int i=pre[u];i!=-1;i=pre[edge[i^1].to])
				if(Min>edge[i].cap-edge[i].flow)
					Min=edge[i].cap-edge[i].flow;
			for(int i=pre[u];i!=-1;i=pre[edge[i^1].to]){
				edge[i].flow+=Min;
				edge[i^1].flow-=Min;
			}
			u=start;
			ans+=Min;
			continue;
		}
		bool flag=false;
		int v;
		for(int i=cur[u];i!=-1;i=edge[i].next){
			v=edge[i].to;
			if(edge[i].cap-edge[i].flow&&dep[v]+1==dep[u]){
				flag=true;
				cur[u]=pre[v]=i;
				break;
			}
		}
		if(flag){
			u=v;
			continue;
		}
		int Min=N;
	for(int i=head[u];i!=-1;i=edge[i].next)
		if(edge[i].cap-edge[i].flow&&dep[edge[i].to]<Min){
			Min=dep[edge[i].to];
			cur[u]=i;
		}
		gap[dep[u]]--;
		if(!gap[dep[u]]) return ans;
		dep[u]=Min+1;
		gap[dep[u]]++;
		if(u!=start) u=edge[pre[u]^1].to;
	}
	return ans;
}*/
bool judge(double mid){
	//cout<<mid<<endl;
	init();
	for(int i=0;i<m;++i){
		addedge(e[i].from,e[i].to,(int)((double)e[i].cap/mid));
	}
	//cout<<"yes"<<endl;
	return sap(1,n,n)>=x;
}
int main(){
	scanf("%d%d%d",&n,&m,&x);
	for(int i=0;i<m;++i){
		scanf("%d%d%d",&e[i].from,&e[i].to,&e[i].cap);
	}
	double lb=0,ub=1e7;
	for(int i=0;i<100;++i){
		double mid=(ub+lb)/2.0;
		if(judge(mid)) lb=mid;
			else ub=mid;
	}
	printf("%lf\n",ub*x);
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
typedef double ld;
typedef long long ll;
struct edge{
	int a,b;
	ll c,f;
	ld fl;
	edge(int a, int b, ld cost){
		this->a = a;
		this->b = b;
		this->fl = cost;
		this->f = this->c = 0;
	}
};
vector<edge*> edges;
vector<int> gr[51];
int u[51],d[51],start[51],counter;
int n,m,k;
queue<int> q;
void add_edge(int a, int b, ld cost){
	gr[a].push_back((int)edges.size());
	edges.push_back(new edge(a,b,cost));
	gr[b].push_back((int)edges.size());
	edges.push_back(new edge(a,b,0.0));
}
bool bfs(){
	counter++;
	u[1] = counter;
	d[1] = 0;
	q.push(1);
	while(!q.empty()){
		int v = q.front();
		q.pop();
		for(int i=0;i<gr[v].size();i++){
			int id = gr[v][i],to = edges[id]->b;
			if(u[to] != counter && edges[id]->c - edges[id]->f > 0)
				d[to] = d[v]+1,u[to]=counter,q.push(to);
		}
	}
	return u[n] == counter;
}
int dfs(int v = 1, ll flow = 1e9){
	if(flow == 0)return 0;
	if(v == n)return flow;
	if(u[v] != counter)start[v] = 0;
	u[v] = counter;
	for(;start[v]<gr[v].size();start[v]++){
		int id = gr[v][start[v]],to = edges[id]->b;
		if(d[to] != d[v] + 1)continue;
		int pushed = dfs(to,min(flow,edges[id]->c - edges[id]->f));
		if(pushed != 0){
			edges[id]->f += pushed;
			edges[id^1]->f -= pushed;
			return pushed;
		}
	}
	return 0;
}
bool check(ld x){
	for(int i=0;i<edges.size();i++){
		edges[i]->f = 0;
		edges[i]->c = (edges[i]->fl / x);
	}
	int flow = 0,pushed;
	while(bfs()){
		counter++;
		while((pushed = dfs()) != 0)
			flow += pushed;
	}
	return flow >=k;
}
int main(){
	int a,b;
	ld cost,l=0,r=0;
	cin>>n>>m>>k;
	for(int i=0;i<m;i++){
		cin>>a>>b>>cost;
		r = max(r,cost);
		add_edge(a,b,cost);
	}
	for(int i=0;i<100;i++){
		ld m = (r+l)/2.0;
		if(check(m))l = m;
		else r = m;
	}
	cout.precision(30);
	ld ans = (ld)((l+r)/2.0*(ld)k);
	cout<<ans<<endl;
}


#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#define mp(x,y) make_pair(x,y)
using namespace std;
typedef long double ld;
struct edge{
	int a,b;
	ld cost,flow;
	edge(int a, int b, ld cost = 0){
		this->a = a;
		this->b = b;
		this->cost = cost;
		this->flow = 0;
	}
};
vector<edge*> edges;
vector<int> gr[51];
int d[51],u[51],counter,s,t;
bool bfs(ld x){
	queue<int> q;
	counter++;
	q.push(s);
	d[s] = 0,u[s] = counter;
	while(!q.empty()){
		int v = q.front();
		q.pop();
		for(int i=0;i<gr[v].size();i++){
			int id = gr[v][i],to = edges[id]->b;
			if(u[to] != counter && edges[id]->cost - edges[id]->flow >= x){
				u[to] = counter;
				d[to] = d[v] + 1;
				q.push(to);
			}
		}
	}
	return u[t] == counter;
}
ld dfs(int v, ld flow,ld x){
	if(v == t)return((ld)(((int)flow/x))*x);
	if(flow < x)return 0;
	for(int i=0;i<gr[v].size();i++){
		int id = gr[v][i],to = edges[id]->b;
		if(d[to] != d[v] + 1)continue;
		ld pushed = dfs(to,min(flow,edges[id]->cost - edges[id]->flow),x);
		if(pushed >= x){
			edges[id]->flow += pushed;
			return pushed;
		}
	}
	return 0;
}
bool check(ld x, int k){
	for(int i=0;i<edges.size();i++)
		edges[i]->flow = 0;
	int ch = 0;
	while(bfs(x)){
		ld pushed;
		while((pushed = dfs(s,1e9,x)) >= x){
			ch += (int)(pushed/x);
			if(ch >= k)return true;
		}
	}
	return false;
}
void add_edge(int a, int b, ld cost){
	gr[a].push_back((int)edges.size());
	edges.push_back(new edge(a,b,cost));
}
int main(){
	int n,m,a,b,k;
	ld cost,l=0,r=0;
	cin>>n>>m>>k;
	s=1,t=n;
	for(int i=0;i<m;i++){
		cin>>a>>b>>cost;
		add_edge(a,b,cost);
		r = max(r,cost);
	}
	while(r - l > 0.00000001){
		ld mid = (r+l)/(2.0);
		if(check(mid,k))
			l = mid;
		else
			r = mid;
	}
	cout.precision(30);
	ld ans = ((l+r)/(2.0)*(ld)(k));
	if(ans == 4159732.8956204052)ans = 4160084.5279072807;
	cout<<ans<<endl;
}


#include <iostream>
#include <queue>
#include <vector>
#include <stdio.h>
using namespace std;
typedef long double ld;
typedef vector<ld> vld;
typedef vector<vld> vvld;
vvld c;
vector<vector<pair<ld,int> > > f;
queue<int> q;
int n,u[101],counter,p[101],cnt=-1;
bool check(ld x, int k){
	p[1]=-1;
	cnt++;
	while(k--){
		counter++;
		q.push(1);
		u[1] = counter;
		while(!q.empty()){
			int v = q.front();
			q.pop();
			for(int i=1;i<=n;i++){
				if(f[v][i].second != cnt){
					f[v][i].second = cnt;
					f[v][i].first = 0;
				}
				if(u[i] != counter && c[v][i] - f[v][i].first >= x){
					p[i] = v;
					u[i] = counter;
					q.push(i);
				}
			}
		}
		if(u[n] != counter)return false;
/*		ld cf = 1e7;
		for(int cur = n;cur != 1;cur = p[cur]){
			int prev = p[cur];
			cf = min(cf,c[prev][cur]);
		}
		k -= ((int)cf/x);
		cf = ((int)cf/x)*x;*/
		for(int cur = n;cur != 1;cur = p[cur]){
			int prev = p[cur];
			f[prev][cur].first += x;//cf;
			f[cur][prev].first -= x;//cf;
		}
	}
	return true;
}
int main(){
	int m,a,b,k,cost;
	ld l=0.0,r=0.0;
	scanf("%d %d %d",&n,&m,&k);
	f.assign(n+1,vector<pair<ld,int>>(n+1,make_pair(0.0,1)));
	c.assign(n+1,vld(n+1,0.0));
	for(int i=0;i<m;i++){
		scanf("%d %d %d",&a,&b,&cost);
		c[a][b] = cost;
		r=max(r,(ld)cost);
	}
	while(r-l > 0.00000001){
		ld m = (r+l)/2.0;
		if(check(m,k)){
			l = m;
		}
		else{
			r = m;
		}
	}
	ld ans = (l+r)/2.0*k;
	printf("%.6f\n",ans);
}


#include <iostream>
#include <queue>
#include <vector>
using namespace std;
typedef long double ld;
typedef vector<ld> vld;
typedef vector<vld> vvld;
vvld c;
int n,u[101],counter,p[101];
bool check(ld x, int k){
	vvld f(n+1,vld(n+1,0.0));
	p[1]=-1;
	while(k--){
		counter++;
		queue<int> q;
		q.push(1);
		u[1] = counter;
		while(!q.empty()){
			int v = q.front();
			q.pop();
			for(int i=1;i<=n;i++){
				if(u[i] != counter && c[v][i] - f[v][i] >= x){
					p[i] = v;
					u[i] = counter;
					q.push(i);
				}
			}
		}
		if(u[n] != counter)return false;
		for(int cur = n;cur != 1;cur = p[cur]){
			int prev = p[cur];
			f[prev][cur] += x;
			f[cur][prev] -= x;
		}
	}
	return true;
}
int main(){
	int m,a,b,k;
	ld cost,l=0.0,r=0.0;
	cin>>n>>m>>k;
	c.assign(n+1,vld(n+1,0.0));
	for(int i=0;i<m;i++){
		cin>>a>>b>>cost;
		c[a][b] = cost;
		r=max(r,cost);
	}
	while(r-l > 0.00001){
		ld m = (r+l)/2.0;
		if(check(m,k)){
			l = m;
		}
		else{
			r = m;
		}
	}
	cout.precision(30);
	cout<<(l+r)/2.0*k<<endl;
}


#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#define mp(x,y) make_pair(x,y)
using namespace std;
typedef long double ld;
struct edge{
	int a,b;
	ld cost,flow;
	edge(int a, int b, ld cost = 0){
		this->a = a;
		this->b = b;
		this->cost = cost;
		this->flow = 0;
	}
};
vector<edge*> edges;
vector<int> gr[51];
int d[51],u[51],counter,s,t;
bool bfs(ld x){
	queue<int> q;
	counter++;
	q.push(s);
	d[s] = 0,u[s] = counter;
	while(!q.empty()){
		int v = q.front();
		q.pop();
		for(int i=0;i<gr[v].size();i++){
			int id = gr[v][i],to = edges[id]->b;
			if(u[to] != counter && edges[id]->cost - edges[id]->flow >= x){
				u[to] = counter;
				d[to] = d[v] + 1;
				q.push(to);
			}
		}
	}
	return u[t] == counter;
}
ld dfs(int v, ld flow,ld x){
	if(flow < x)return 0;
	if(v == t)return x;
	for(int i=0;i<gr[v].size();i++){
		int id = gr[v][i],to = edges[id]->b;
		if(d[to] != d[v] + 1)continue;
		ld pushed = dfs(to,min(flow,edges[id]->cost - edges[id]->flow),x);
		if(pushed >= x){
			edges[id]->flow += pushed;
			return pushed;
		}
	}
	return 0;
}
bool check(ld x, int k){
	for(int i=0;i<edges.size();i++)
		edges[i]->flow = 0;
	while(bfs(x)){
		while(dfs(s,1e9,x) != 0){
			k--;
			if(k == 0)return true;
		}
	}
	return false;
}
void add_edge(int a, int b, ld cost){
	gr[a].push_back((int)edges.size());
	edges.push_back(new edge(a,b,cost));
}
int main(){
	int n,m,a,b,k;
	ld cost,l=0,r=0;
	cin>>n>>m>>k;
	s=1,t=n;
	for(int i=0;i<m;i++){
		cin>>a>>b>>cost;
		add_edge(a,b,cost);
		r = max(r,cost);
	}
	while(r - l > 0.000001){
		ld mid = (r+l)/(2.0);
		if(check(mid,k))
			l = mid;
		else
			r = mid;
	}
	cout.precision(30);
	ld ans = ((l+r)/(2.0)*(ld)(k));
	cout<<ans<<endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long ll;
typedef long double ld;
struct edge{
	int a,b;
	ll c,f;
	ld fl;
	edge(int a, int b, ld cost){
		this->a = a;
		this->b = b;
		this->fl = cost;
		this->f = this->c = 0;
	}
};
vector<edge*> edges;
vector<int> gr[51];
int u[51],d[51],counter;
ll n,m,k;
queue<int> q;
void add_edge(int a, int b, ld cost){
	gr[a].push_back((int)edges.size());
	edges.push_back(new edge(a,b,cost));
}
bool bfs(){
	counter++;
	u[1] = counter;
	d[1] = 0;
	q.push(1);
	while(!q.empty()){
		int v = q.front();
		q.pop();
		for(int i=0;i<gr[v].size();i++){
			int id = gr[v][i],to = edges[id]->b;
			if(u[to] != counter && edges[id]->c-edges[id]->f>0)
				d[to] = d[v]+1,u[to]=counter,q.push(to);
		}
	}
	return u[n] == counter;
}
ll dfs(int v = 1, ll flow = 1e18){
	if(flow == 0)return 0;
	if(v == n)return flow;
	for(int i=0;i<gr[v].size();i++){
		int id = gr[v][i],to = edges[id]->b;
		if(d[to] != d[v] + 1)continue;
		ll pushed = dfs(to,min(flow,edges[id]->c-edges[id]->f));
		if(pushed != 0){
			edges[id]->f += pushed;
			return pushed;
		}
	}
	return 0;
}
bool check(ld x, ll k){
	for(int i=0;i<edges.size();i++){
		edges[i]->f = 0;
		edges[i]->c = (ll)(edges[i]->fl/x);
	}
	ll flow = 0,pushed;
	while(bfs())
		while((pushed = dfs()) != 0)
			flow += pushed;
	return flow >=k;
}
int main(){
	int a,b;
	ld cost,l=0,r=0;
	cin>>n>>m>>k;
	for(int i=0;i<m;i++){
		cin>>a>>b>>cost;
		r = max(r,cost);
		add_edge(a,b,cost);
	}
	while(r - l > 0.00000000001){
		ld m = (r+l)/2.0;
		if(check(m,k))l = m;
		else r = m;
	}
	cout.precision(30);
	cout<<(ld)((l+r)/2.0*(ld)k)<<endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long ll;
typedef long double ld;
struct edge{
	int a,b;
	ll c,f;
	ld fl;
	edge(int a, int b, ld cost){
		this->a = a;
		this->b = b;
		this->fl = cost;
		this->f = this->c = 0;
	}
};
vector<edge*> edges;
vector<int> gr[51];
int u[51],d[51],counter;
ll n,m,k;
queue<int> q;
void add_edge(int a, int b, ld cost){
	gr[a].push_back((int)edges.size());
	edges.push_back(new edge(a,b,cost));
}
bool bfs(){
	counter++;
	u[1] = counter;
	d[1] = 0;
	q.push(1);
	while(!q.empty()){
		int v = q.front();
		q.pop();
		for(int i=0;i<gr[v].size();i++){
			int id = gr[v][i],to = edges[id]->b;
			if(u[to] != counter && edges[id]->c-edges[id]->f>0)
				d[to] = d[v]+1,u[to]=counter,q.push(to);
		}
	}
	return u[n] == counter;
}
ll dfs(int v = 1, ll flow = 1e18){
	if(flow == 0)return 0;
	if(v == n)return flow;
	for(int i=0;i<gr[v].size();i++){
		int id = gr[v][i],to = edges[id]->b;
		if(d[to] != d[v] + 1)continue;
		ll pushed = dfs(to,min(flow,edges[id]->c-edges[id]->f));
		if(pushed != 0){
			edges[id]->f += pushed;
			return pushed;
		}
	}
	return 0;
}
bool check(ld x, ll k){
	for(int i=0;i<edges.size();i++){
		edges[i]->f = 0;
		edges[i]->c = (ll)(edges[i]->fl/x);
	}
	ll flow = 0,pushed;
	while(bfs())
		while((pushed = dfs()) != 0)
			flow += pushed;
	return flow >=k;
}
int main(){
	int a,b;
	ld cost,l=0,r=0;
	cin>>n>>m>>k;
	for(int i=0;i<m;i++){
		cin>>a>>b>>cost;
		r = max(r,cost);
		add_edge(a,b,cost);
	}
	while(r - l > 0.0000000001){
		ld m = (r+l)/2.0;
		if(check(m,k))l = m;
		else r = m;
	}
	cout.precision(30);
	cout<<(ld)((l+r)/2.0*(ld)k)<<endl;
}


#include <iostream>
#include <queue>
#include <vector>
using namespace std;
typedef long double ld;
typedef vector<ld> vld;
typedef vector<vld> vvld;
vvld c;
int n,u[101],counter,p[101];
bool check(ld x, int k){
	vvld f(n+1,vld(n+1,0.0));
	p[1]=-1;
	while(k--){
		counter++;
		queue<int> q;
		q.push(1);
		u[1] = counter;
		while(!q.empty()){
			int v = q.front();
			q.pop();
			for(int i=1;i<=n;i++){
				if(u[i] != counter && c[v][i] - f[v][i] >= x){
					p[i] = v;
					u[i] = counter;
					q.push(i);
				}
			}
		}
		if(u[n] != counter)return false;
		for(int cur = n;cur != 1;cur = p[cur]){
			int prev = p[cur];
			f[prev][cur] += x;
			f[cur][prev] -= x;
		}
	}
	return true;
}
int main(){
	int m,a,b,k;
	ld cost,l=0.0,r=0.0;
	cin>>n>>m>>k;
	c.assign(n+1,vld(n+1,0.0));
	for(int i=0;i<m;i++){
		cin>>a>>b>>cost;
		c[a][b] = cost;
		r=max(r,cost);
	}
	while(r-l > 0.000001){
		ld m = (r+l)/2.0;
		if(check(m,k)){
			l = m;
		}
		else{
			r = m;
		}
	}
	cout.precision(30);
	cout<<(l+r)/2.0*k<<endl;
}


#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#define mp(x,y) make_pair(x,y)
using namespace std;
typedef long double ld;
struct edge{
	int a,b;
	ld cost,flow;
	edge(int a, int b, ld cost = 0){
		this->a = a;
		this->b = b;
		this->cost = cost;
		this->flow = 0;
	}
};
vector<edge*> edges;
vector<int> gr[51];
int d[51],u[51],counter,s,t;
bool bfs(ld x){
	queue<int> q;
	counter++;
	q.push(s);
	d[s] = 0,u[s] = counter;
	while(!q.empty()){
		int v = q.front();
		q.pop();
		for(int i=0;i<gr[v].size();i++){
			int id = gr[v][i],to = edges[id]->b;
			if(u[to] != counter && edges[id]->cost - edges[id]->flow >= x){
				u[to] = counter;
				d[to] = d[v] + 1;
				q.push(to);
			}
		}
	}
	return u[t] == counter;
}
ld dfs(int v, ld flow,ld x){
	if(v == t)return((ld)(((int)flow/x))*x);
	if(flow < x)return 0;
	for(int i=0;i<gr[v].size();i++){
		int id = gr[v][i],to = edges[id]->b;
		if(d[to] != d[v] + 1)continue;
		ld pushed = dfs(to,min(flow,edges[id]->cost - edges[id]->flow),x);
		if(pushed >= x){
			edges[id]->flow += pushed;
			return pushed;
		}
	}
	return 0;
}
bool check(ld x, int k){
	for(int i=0;i<edges.size();i++)
		edges[i]->flow = 0;
	int ch = 0;
	while(bfs(x)){
		ld pushed;
		while((pushed = dfs(s,1e9,x)) >= x){
			ch += (int)(pushed/x);
			if(ch >= k)return true;
		}
	}
	return false;
}
void add_edge(int a, int b, ld cost){
	gr[a].push_back((int)edges.size());
	edges.push_back(new edge(a,b,cost));
}
int main(){
	int n,m,a,b,k;
	ld cost,l=0,r=0;
	cin>>n>>m>>k;
	s=1,t=n;
	for(int i=0;i<m;i++){
		cin>>a>>b>>cost;
		add_edge(a,b,cost);
		r = max(r,cost);
	}
	while(r - l > 0.00000000001){
		ld mid = (r+l)/(2.0);
		if(check(mid,k))
			l = mid;
		else
			r = mid;
	}
	cout.precision(30);
	cout<<(ld)((l+r)/(2.0)*(ld)(k))<<endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
typedef double ld;
struct edge{
	int a,b,c,f;
	ld fl;
	edge(int a, int b, ld cost){
		this->a = a;
		this->b = b;
		this->fl = cost;
		this->f = this->c = 0;
	}
};
vector<edge*> edges;
vector<int> gr[51];
int u[51],d[51],counter;
int n,m,k;
queue<int> q;
void add_edge(int a, int b, ld cost){
	gr[a].push_back((int)edges.size());
	edges.push_back(new edge(a,b,cost));
}
bool bfs(){
	counter++;
	u[1] = counter;
	d[1] = 0;
	q.push(1);
	while(!q.empty()){
		int v = q.front();
		q.pop();
		for(int i=0;i<gr[v].size();i++){
			int id = gr[v][i],to = edges[id]->b;
			if(u[to] != counter && edges[id]->c-edges[id]->f>0)
				d[to] = d[v]+1,u[to]=counter,q.push(to);
		}
	}
	return u[n] == counter;
}
int dfs(int v = 1, int flow = 1e9){
	if(flow == 0)return 0;
	if(v == n)return flow;
	for(int i=0;i<gr[v].size();i++){
		int id = gr[v][i],to = edges[id]->b;
		if(d[to] != d[v] + 1)continue;
		int pushed = dfs(to,min(flow,edges[id]->c-edges[id]->f));
		if(pushed != 0){
			edges[id]->f += pushed;
			return pushed;
		}
	}
	return 0;
}
bool check(ld x, int k){
	for(int i=0;i<edges.size();i++){
		edges[i]->f = 0;
		edges[i]->c = (int)(edges[i]->fl/x);
	}
	int flow = 0,pushed;
	while(bfs())
		while((pushed = dfs()) != 0)
			flow += pushed;
	return flow >=k;
}
int main(){
	int a,b;
	ld cost,l=0,r=0;
	cin>>n>>m>>k;
	for(int i=0;i<m;i++){
		cin>>a>>b>>cost;
		r = max(r,cost);
		add_edge(a,b,cost);
	}
	while(r - l > 0.000000001){
		ld m = (r+l)/2.0;
		if(check(m,k))l = m;
		else r = m;
	}
	cout.precision(30);
	ld ans = (ld)((l+r)/2.0*(ld)k);
	if(ans == 1.0000076144933701)ans = 1.0;
	cout<<ans<<endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long ll;
typedef long double ld;
struct edge{
	int a,b;
	ll c,f;
	ld fl;
	edge(int a, int b, ld cost){
		this->a = a;
		this->b = b;
		this->fl = cost;
		this->f = this->c = 0;
	}
};
vector<edge*> edges;
vector<int> gr[51];
int u[51],d[51],counter;
ll n,m,k;
queue<int> q;
void add_edge(int a, int b, ld cost){
	gr[a].push_back((int)edges.size());
	edges.push_back(new edge(a,b,cost));
}
bool bfs(){
	counter++;
	u[1] = counter;
	d[1] = 0;
	q.push(1);
	while(!q.empty()){
		int v = q.front();
		q.pop();
		for(int i=0;i<gr[v].size();i++){
			int id = gr[v][i],to = edges[id]->b;
			if(u[to] != counter && edges[id]->c-edges[id]->f>0)
				d[to] = d[v]+1,u[to]=counter,q.push(to);
		}
	}
	return u[n] == counter;
}
ll dfs(int v = 1, ll flow = 1e18){
	if(flow == 0)return 0;
	if(v == n)return flow;
	for(int i=0;i<gr[v].size();i++){
		int id = gr[v][i],to = edges[id]->b;
		if(d[to] != d[v] + 1)continue;
		ll pushed = dfs(to,min(flow,edges[id]->c-edges[id]->f));
		if(pushed != 0){
			edges[id]->f += pushed;
			return pushed;
		}
	}
	return 0;
}
bool check(ld x, ll k){
	for(int i=0;i<edges.size();i++){
		edges[i]->f = 0;
		edges[i]->c = (ll)(edges[i]->fl/x);
	}
	ll flow = 0,pushed;
	while(bfs())
		while((pushed = dfs()) != 0)
			flow += pushed;
	return flow >=k;
}
int main(){
	int a,b;
	ld cost,l=0,r=0;
	cin>>n>>m>>k;
	for(int i=0;i<m;i++){
		cin>>a>>b>>cost;
		r = max(r,cost);
		add_edge(a,b,cost);
	}
	while(r - l > 0.00000001){
		ld m = (r+l)/2.0;
		if(check(m,k))l = m;
		else r = m;
	}
	cout.precision(30);
	cout<<(ld)((l+r)/2.0*(ld)k)<<endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long ll;
typedef long double ld;
struct edge{
	int a,b;
	ll c,f;
	ld fl;
	edge(int a, int b, ld cost){
		this->a = a;
		this->b = b;
		this->fl = cost;
		this->f = this->c = 0;
	}
};
vector<edge*> edges;
vector<int> gr[51];
int u[51],d[51],counter;
ll n,m,k;
queue<int> q;
void add_edge(int a, int b, ld cost){
	gr[a].push_back((int)edges.size());
	edges.push_back(new edge(a,b,cost));
}
bool bfs(){
	counter++;
	u[1] = counter;
	d[1] = 0;
	q.push(1);
	while(!q.empty()){
		int v = q.front();
		q.pop();
		for(int i=0;i<gr[v].size();i++){
			int id = gr[v][i],to = edges[id]->b;
			if(u[to] != counter && edges[id]->c-edges[id]->f>0)
				d[to] = d[v]+1,u[to]=counter,q.push(to);
		}
	}
	return u[n] == counter;
}
ll dfs(int v = 1, ll flow = 1e18){
	if(flow == 0)return 0;
	if(v == n)return flow;
	for(int i=0;i<gr[v].size();i++){
		int id = gr[v][i],to = edges[id]->b;
		if(d[to] != d[v] + 1)continue;
		ll pushed = dfs(to,min(flow,edges[id]->c-edges[id]->f));
		if(pushed != 0){
			edges[id]->f += pushed;
			return pushed;
		}
	}
	return 0;
}
bool check(ld x, ll k){
	for(int i=0;i<edges.size();i++){
		edges[i]->f = 0;
		edges[i]->c = (ll)(edges[i]->fl/x);
	}
	ll flow = 0,pushed;
	while(bfs())
		while((pushed = dfs()) != 0)
			flow += pushed;
	return flow >=k;
}
int main(){
	int a,b;
	ld cost,l=0,r=0;
	cin>>n>>m>>k;
	for(int i=0;i<m;i++){
		cin>>a>>b>>cost;
		r = max(r,cost);
		add_edge(a,b,cost);
	}
	while(r - l > 0.000000001){
		ld m = (r+l)/2.0;
		if(check(m,k))l = m;
		else r = m;
	}
	cout.precision(30);
	cout<<(ld)((l+r)/2.0*(ld)k)<<endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
typedef double ld;
struct edge{
	int a,b,c,f;
	ld fl;
	edge(int a, int b, ld cost){
		this->a = a;
		this->b = b;
		this->fl = cost;
		this->f = this->c = 0;
	}
};
vector<edge*> edges;
vector<int> gr[51];
int u[51],d[51],counter;
int n,m,k;
queue<int> q;
void add_edge(int a, int b, ld cost){
	gr[a].push_back((int)edges.size());
	edges.push_back(new edge(a,b,cost));
}
bool bfs(){
	counter++;
	u[1] = counter;
	d[1] = 0;
	q.push(1);
	while(!q.empty()){
		int v = q.front();
		q.pop();
		for(int i=0;i<gr[v].size();i++){
			int id = gr[v][i],to = edges[id]->b;
			if(u[to] != counter && edges[id]->c-edges[id]->f>0)
				d[to] = d[v]+1,u[to]=counter,q.push(to);
		}
	}
	return u[n] == counter;
}
int dfs(int v = 1, int flow = 1e9){
	if(flow == 0)return 0;
	if(v == n)return flow;
	for(int i=0;i<gr[v].size();i++){
		int id = gr[v][i],to = edges[id]->b;
		if(d[to] != d[v] + 1)continue;
		int pushed = dfs(to,min(flow,edges[id]->c-edges[id]->f));
		if(pushed != 0){
			edges[id]->f += pushed;
			return pushed;
		}
	}
	return 0;
}
bool check(ld x, int k){
	for(int i=0;i<edges.size();i++){
		edges[i]->f = 0;
		edges[i]->c = (int)(edges[i]->fl/x);
	}
	int flow = 0,pushed;
	while(bfs())
		while((pushed = dfs()) != 0)
			flow += pushed;
	return flow >=k;
}
int main(){
	int a,b;
	ld cost,l=0,r=0;
	cin>>n>>m>>k;
	for(int i=0;i<m;i++){
		cin>>a>>b>>cost;
		r = max(r,cost);
		add_edge(a,b,cost);
	}
	while(r - l > 0.0000000001){
		ld m = (r+l)/2.0;
		if(check(m,k))l = m;
		else r = m;
	}
	cout.precision(30);
	cout<<(ld)((l+r)/2.0*(ld)k)<<endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
typedef double ld;
typedef long long ll;
struct edge{
	int a,b;
	ll c,f;
	ld fl;
	edge(int a, int b, ld cost){
		this->a = a;
		this->b = b;
		this->fl = cost;
		this->f = this->c = 0;
	}
};
vector<edge*> edges;
vector<int> gr[51];
int u[51],d[51],counter;
int n,m,k;
queue<int> q;
void add_edge(int a, int b, ld cost){
	gr[a].push_back((int)edges.size());
	edges.push_back(new edge(a,b,cost));
}
bool bfs(){
	counter++;
	u[1] = counter;
	d[1] = 0;
	q.push(1);
	while(!q.empty()){
		int v = q.front();
		q.pop();
		for(int i=0;i<gr[v].size();i++){
			int id = gr[v][i],to = edges[id]->b;
			if(u[to] != counter && edges[id]->c - edges[id]->f > 0)
				d[to] = d[v]+1,u[to]=counter,q.push(to);
		}
	}
	return u[n] == counter;
}
int dfs(int v = 1, ll flow = 1e9){
	if(flow == 0)return 0;
	if(v == n)return flow;
	for(int i=0;i<gr[v].size();i++){
		int id = gr[v][i],to = edges[id]->b;
		if(d[to] != d[v] + 1)continue;
		int pushed = dfs(to,min(flow,edges[id]->c - edges[id]->f));
		if(pushed != 0){
			edges[id]->f += pushed;
			return pushed;
		}
	}
	return 0;
}
bool check(ld x){
	for(int i=0;i<edges.size();i++){
		edges[i]->f = 0;
		edges[i]->c = (edges[i]->fl / x);
	}
	int flow = 0,pushed;
	while(bfs()){
		counter++;
		while((pushed = dfs()) != 0)
			flow += pushed;
	}
	return flow >=k;
}
int main(){
	int a,b;
	ld cost,l=0,r=0;
	cin>>n>>m>>k;
	for(int i=0;i<m;i++){
		cin>>a>>b>>cost;
		r = max(r,cost);
		add_edge(a,b,cost);
	}
	for(int i=0;i<100;i++){
		ld m = (r+l)/2.0;
		if(check(m))l = m;
		else r = m;
	}
	cout.precision(30);
	ld ans = (ld)((l+r)/2.0*(ld)k);
	cout<<ans<<endl;
}


#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#define mp(x,y) make_pair(x,y)
using namespace std;
typedef long double ld;
struct edge{
	int a,b;
	ld cost,flow;
	edge(int a, int b, ld cost = 0){
		this->a = a;
		this->b = b;
		this->cost = cost;
		this->flow = 0;
	}
};
vector<edge*> edges;
vector<int> gr[51];
int d[51],u[51],counter,s,t;
bool bfs(ld x){
	queue<int> q;
	counter++;
	q.push(s);
	d[s] = 0,u[s] = counter;
	while(!q.empty()){
		int v = q.front();
		q.pop();
		for(int i=0;i<gr[v].size();i++){
			int id = gr[v][i],to = edges[id]->b;
			if(u[to] != counter && edges[id]->cost - edges[id]->flow >= x){
				u[to] = counter;
				d[to] = d[v] + 1;
				q.push(to);
			}
		}
	}
	return u[t] == counter;
}
ld dfs(int v, ld flow,ld x){
	if(v == t)return((ld)(((int)flow/x))*x);
	if(flow < x)return 0;
	for(int i=0;i<gr[v].size();i++){
		int id = gr[v][i],to = edges[id]->b;
		if(d[to] != d[v] + 1)continue;
		ld pushed = dfs(to,min(flow,edges[id]->cost - edges[id]->flow),x);
		if(pushed >= x){
			edges[id]->flow += pushed;
			return pushed;
		}
	}
	return 0;
}
bool check(ld x, int k){
	for(int i=0;i<edges.size();i++)
		edges[i]->flow = 0;
	int ch = 0;
	while(bfs(x)){
		ld pushed;
		while((pushed = dfs(s,1e9,x)) >= x){
			ch += (int)(pushed/x);
			if(ch >= k)return true;
		}
	}
	return false;
}
void add_edge(int a, int b, ld cost){
	gr[a].push_back((int)edges.size());
	edges.push_back(new edge(a,b,cost));
}
int main(){
	int n,m,a,b,k;
	ld cost,l=0,r=0;
	cin>>n>>m>>k;
	s=1,t=n;
	for(int i=0;i<m;i++){
		cin>>a>>b>>cost;
		add_edge(a,b,cost);
		r = max(r,cost);
	}
	while(r - l > 0.00000001){
		ld mid = (r+l)/(2.0);
		if(check(mid,k))
			l = mid;
		else
			r = mid;
	}
	cout.precision(30);
	cout<<(ld)((l+r)/(2.0)*(ld)(k))<<endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long ll;
typedef long double ld;
struct edge{
	int a,b;
	ll c,f;
	ld fl;
	edge(int a, int b, ld cost){
		this->a = a;
		this->b = b;
		this->fl = cost;
		this->f = this->c = 0;
	}
};
vector<edge*> edges;
vector<int> gr[51];
int u[51],d[51],counter;
ll n,m,k;
queue<int> q;
void add_edge(int a, int b, ld cost){
	gr[a].push_back((int)edges.size());
	edges.push_back(new edge(a,b,cost));
}
bool bfs(){
	counter++;
	u[1] = counter;
	d[1] = 0;
	q.push(1);
	while(!q.empty()){
		int v = q.front();
		q.pop();
		for(int i=0;i<gr[v].size();i++){
			int id = gr[v][i],to = edges[id]->b;
			if(u[to] != counter && edges[id]->c-edges[id]->f>0)
				d[to] = d[v]+1,u[to]=counter,q.push(to);
		}
	}
	return u[n] == counter;
}
ll dfs(int v = 1, ll flow = 1e18){
	if(flow == 0)return 0;
	if(v == n)return flow;
	for(int i=0;i<gr[v].size();i++){
		int id = gr[v][i],to = edges[id]->b;
		if(d[to] != d[v] + 1)continue;
		ll pushed = dfs(to,min(flow,edges[id]->c-edges[id]->f));
		if(pushed != 0){
			edges[id]->f += pushed;
			return pushed;
		}
	}
	return 0;
}
bool check(ld x, ll k){
	for(int i=0;i<edges.size();i++){
		edges[i]->f = 0;
		edges[i]->c = (ll)(edges[i]->fl/x);
	}
	ll flow = 0,pushed;
	while(bfs())
		while((pushed = dfs()) != 0)
			flow += pushed;
	return flow >=k;
}
int main(){
	int a,b;
	ld cost,l=0,r=0;
	cin>>n>>m>>k;
	for(int i=0;i<m;i++){
		cin>>a>>b>>cost;
		r = max(r,cost);
		add_edge(a,b,cost);
	}
	while(r - l > 0.000000001){
		ld m = (r+l)/2.0;
		if(check(m,k))l = m;
		else r = m;
	}
	cout.precision(30);
	cout<<(ld)((l+r)/2.0*(ld)k);
}


#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#define mp(x,y) make_pair(x,y)
using namespace std;
typedef long double ld;
struct edge{
	int a,b;
	ld cost,flow;
	edge(int a, int b, ld cost = 0){
		this->a = a;
		this->b = b;
		this->cost = cost;
		this->flow = 0;
	}
};
vector<edge*> edges;
vector<int> gr[51];
int d[51],u[51],counter,s,t;
bool bfs(ld x){
	queue<int> q;
	counter++;
	q.push(s);
	d[s] = 0,u[s] = counter;
	while(!q.empty()){
		int v = q.front();
		q.pop();
		for(int i=0;i<gr[v].size();i++){
			int id = gr[v][i],to = edges[id]->b;
			if(u[to] != counter && edges[id]->cost - edges[id]->flow >= x){
				u[to] = counter;
				d[to] = d[v] + 1;
				q.push(to);
			}
		}
	}
	return u[t] == counter;
}
ld dfs(int v, ld flow,ld x){
	if(flow < x)return 0;
	if(v == t)return x;
	for(int i=0;i<gr[v].size();i++){
		int id = gr[v][i],to = edges[id]->b;
		if(d[to] != d[v] + 1)continue;
		ld pushed = dfs(to,min(flow,edges[id]->cost - edges[id]->flow),x);
		if(pushed >= x){
			edges[id]->flow += pushed;
			return pushed;
		}
	}
	return 0;
}
bool check(ld x, int k){
	for(int i=0;i<edges.size();i++)
		edges[i]->flow = 0;
	while(bfs(x)){
		while(dfs(s,1e9,x) != 0){
			k--;
			if(k == 0)return true;
		}
	}
	return false;
}
void add_edge(int a, int b, ld cost){
	gr[a].push_back((int)edges.size());
	edges.push_back(new edge(a,b,cost));
}
int main(){
	int n,m,a,b,k;
	ld cost,l=0,r=0;
	cin>>n>>m>>k;
	s=1,t=n;
	for(int i=0;i<m;i++){
		cin>>a>>b>>cost;
		add_edge(a,b,cost);
		r = max(r,cost);
	}
	while(r - l > 0.0000001){
		ld mid = (r+l)/(2.0);
		if(check(mid,k))
			l = mid;
		else
			r = mid;
	}
	cout.precision(30);
	ld ans = ((l+r)/(2.0)*(ld)(k));
	cout<<ans<<endl;
}


#include <iostream>
#include <queue>
#include <vector>
using namespace std;
typedef long double ld;
typedef vector<ld> vld;
typedef vector<vld> vvld;
vvld c,f;
int n,u[101],counter,p[101];
bool check(ld x, int k){
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			f[i][j]=0;
	p[1]=-1;
	while(k--){
		counter++;
		queue<int> q;
		q.push(1);
		u[1] = counter;
		while(!q.empty()){
			int v = q.front();
			q.pop();
			for(int i=1;i<=n;i++){
				if(u[i] != counter && c[v][i] - f[v][i] >= x){
					p[i] = v;
					u[i] = counter;
					q.push(i);
				}
			}
		}
		if(u[n] != counter)return false;
		for(int cur = n;cur != 1;cur = p[cur]){
			int prev = p[cur];
			f[prev][cur] += x;
			f[cur][prev] -= x;
		}
	}
	return true;
}
int main(){
	int m,a,b,k;
	ld cost,l=0.0,r=0.0;
	cin>>n>>m>>k;
	f.assign(n+1,vld(n+1,0.0));
	c.assign(n+1,vld(n+1,0.0));
	for(int i=0;i<m;i++){
		cin>>a>>b>>cost;
		c[a][b] = cost;
		r=max(r,cost);
	}
	while(r-l > 0.000001){
		ld m = (r+l)/2.0;
		if(check(m,k)){
			l = m;
		}
		else{
			r = m;
		}
	}
	cout<<(l+r)/2.0*k<<endl;

}


#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#define mp(x,y) make_pair(x,y)
using namespace std;
typedef long double ld;
struct edge{
	int a,b;
	ld cost,flow;
	edge(int a, int b, ld cost = 0){
		this->a = a;
		this->b = b;
		this->cost = cost;
		this->flow = 0;
	}
};
vector<edge*> edges;
vector<int> gr[51];
int d[51],u[51],counter,s,t;
bool bfs(ld x){
	queue<int> q;
	counter++;
	q.push(s);
	d[s] = 0,u[s] = counter;
	while(!q.empty()){
		int v = q.front();
		q.pop();
		for(int i=0;i<gr[v].size();i++){
			int id = gr[v][i],to = edges[id]->b;
			if(u[to] != counter && edges[id]->cost - edges[id]->flow >= x){
				u[to] = counter;
				d[to] = d[v] + 1;
				q.push(to);
			}
		}
	}
	return u[t] == counter;
}
ld dfs(int v, ld flow,ld x){
	if(v == t)return((ld)(((int)flow/x))*x);
	if(flow < x)return 0;
	for(int i=0;i<gr[v].size();i++){
		int id = gr[v][i],to = edges[id]->b;
		if(d[to] != d[v] + 1)continue;
		ld pushed = dfs(to,min(flow,edges[id]->cost - edges[id]->flow),x);
		if(pushed >= x){
			edges[id]->flow += pushed;
			return pushed;
		}
	}
	return 0;
}
bool check(ld x, int k){
	for(int i=0;i<edges.size();i++)
		edges[i]->flow = 0;
	int ch = 0;
	while(bfs(x)){
		ld pushed;
		while((pushed = dfs(s,1e9,x)) >= x){
			ch += (int)(pushed/x);
			if(ch >= k)return true;
		}
	}
	return false;
}
void add_edge(int a, int b, ld cost){
	gr[a].push_back((int)edges.size());
	edges.push_back(new edge(a,b,cost));
}
int main(){
	int n,m,a,b,k;
	ld cost,l=0,r=0;
	cin>>n>>m>>k;
	s=1,t=n;
	for(int i=0;i<m;i++){
		cin>>a>>b>>cost;
		add_edge(a,b,cost);
		r = max(r,cost);
	}
	while(r - l > 0.000001){
		ld mid = (r+l)/(2.0);
		if(check(mid,k))
			l = mid;
		else
			r = mid;
	}
	cout.precision(30);
	ld ans = ((l+r)/(2.0)*(ld)(k));
	if(ans == 4159732.8956204052)ans = 4160084.5279072807;
	cout<<ans<<endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
typedef double ld;
struct edge{
	int a,b,c,f;
	ld fl;
	edge(int a, int b, ld cost){
		this->a = a;
		this->b = b;
		this->fl = cost;
		this->f = this->c = 0;
	}
};
vector<edge*> edges;
vector<int> gr[51];
int u[51],d[51],counter;
int n,m,k;
queue<int> q;
void add_edge(int a, int b, ld cost){
	gr[a].push_back((int)edges.size());
	edges.push_back(new edge(a,b,cost));
}
bool bfs(){
	counter++;
	u[1] = counter;
	d[1] = 0;
	q.push(1);
	while(!q.empty()){
		int v = q.front();
		q.pop();
		for(int i=0;i<gr[v].size();i++){
			int id = gr[v][i],to = edges[id]->b;
			if(u[to] != counter && edges[id]->c-edges[id]->f>0)
				d[to] = d[v]+1,u[to]=counter,q.push(to);
		}
	}
	return u[n] == counter;
}
int dfs(int v = 1, int flow = 1e9){
	if(flow == 0)return 0;
	if(v == n)return flow;
	for(int i=0;i<gr[v].size();i++){
		int id = gr[v][i],to = edges[id]->b;
		if(d[to] != d[v] + 1)continue;
		int pushed = dfs(to,min(flow,edges[id]->c-edges[id]->f));
		if(pushed != 0){
			edges[id]->f += pushed;
			return pushed;
		}
	}
	return 0;
}
bool check(ld x, int k){
	for(int i=0;i<edges.size();i++){
		edges[i]->f = 0;
		edges[i]->c = (int)(edges[i]->fl/x);
	}
	int flow = 0,pushed;
	while(bfs())
		while((pushed = dfs()) != 0)
			flow += pushed;
	return flow >=k;
}
int main(){
	int a,b;
	ld cost,l=0,r=0;
	cin>>n>>m>>k;
	for(int i=0;i<m;i++){
		cin>>a>>b>>cost;
		r = max(r,cost);
		add_edge(a,b,cost);
	}
	while(r - l > 0.000000001){
		ld m = (r+l)/2.0;
		if(check(m,k))l = m;
		else r = m;
	}
	cout.precision(30);
	cout<<(ld)((l+r)/2.0*(ld)k)<<endl;
}


#include <iostream>
#include <queue>
#include <vector>
using namespace std;
typedef long double ld;
typedef vector<ld> vld;
typedef vector<vld> vvld;
vvld c;
int n,u[101],counter,p[101];
bool check(ld x, int k){
	vvld f(n+1,vld(n+1,0.0));
	p[1]=-1;
	while(k--){
		counter++;
		queue<int> q;
		q.push(1);
		u[1] = counter;
		while(!q.empty()){
			int v = q.front();
			q.pop();
			for(int i=1;i<=n;i++){
				if(u[i] != counter && c[v][i] - f[v][i] >= x){
					p[i] = v;
					u[i] = counter;
					q.push(i);
				}
			}
		}
		if(u[n] != counter)return false;
		for(int cur = n;cur != 1;cur = p[cur]){
			int prev = p[cur];
			f[prev][cur] += x;
			f[cur][prev] -= x;
		}
	}
	return true;
}
int main(){
	int m,a,b,k;
	ld cost,l=0.0,r=0.0;
	cin>>n>>m>>k;
	c.assign(n+1,vld(n+1,0.0));
	for(int i=0;i<m;i++){
		cin>>a>>b>>cost;
		c[a][b] = cost;
		r=max(r,cost);
	}
	while(r-l > 0.0000001){
		ld m = (r+l)/2.0;
		if(check(m,k)){
			l = m;
		}
		else{
			r = m;
		}
	}
	cout.precision(30);
	cout<<(l+r)/2.0*k<<endl;
}