#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <vector>
#include <ctime>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <iomanip>
#include <fstream>
using namespace std;
#define fname ""
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define inf 1000000000

const int N = 550;
struct edge {
    int from, to, cap, flow;
};
vector <edge> allEdges;
vector <int> edges[N];
int n;

void add(int x, int y, int z) {
    edge e1 = {x, y, z, 0}, e2 = {y, x, 0, 0};
    edges[x].push_back((int)allEdges.size());
    allEdges.push_back(e1);
    edges[y].push_back((int)allEdges.size());
    allEdges.push_back(e2);
}

int nxt[N], block[N];

queue <int> q;

bool bfs() {
    memset(block, 0, sizeof block);
    block[0] = 1;
    q.push(0);
    while (!q.empty()) {
        int v = q.front();
        q.pop();
        for (int i = 0; i < (int)edges[v].size(); ++i) {
            int id = edges[v][i];
            if (!block[allEdges[id].to] && allEdges[id].cap > allEdges[id].flow) {
                block[allEdges[id].to] = block[v] + 1;
                q.push(allEdges[id].to);
            }
        }
    }
    return (block[n - 1] > 0);
}

int dfs(int v, int mn = inf) {
    if (!mn || v == n - 1) {
        return mn;
    }
    for (; nxt[v] < (int)edges[v].size(); ++nxt[v]) {
        int id = edges[v][nxt[v]];
        if (block[v] + 1 == block[allEdges[id].to] &&
            allEdges[id].cap - allEdges[id].flow > 0) {
            int Min = min(mn, allEdges[id].cap - allEdges[id].flow);
            int cur = dfs(allEdges[id].to, Min);
            if (cur != 0) {
                allEdges[id].flow += cur;
                allEdges[id ^ 1].flow -= cur;
                return cur;
            }
        }
    }
    return 0;
}

long long MaxFlow() {
    long long flow = 0;
    while (bfs()) {
//	   cout << "asd";
       memset(nxt, 0, sizeof nxt);
       while (int pushed = dfs(0)) flow += pushed;
    }
    return flow;
}

int xx[777], yy[777], zz[777], m, k;

inline bool ok(double weight) {

	for (int i = 0; i <= n; ++ i) edges[i].clear();
	allEdges.clear();

	for (int i = 1; i <= m; ++ i) {
		int ss = (double)zz[i] / weight;
//		cout << xx[i] << " " << yy[i] << " " << ss << endl;
		add(xx[i] - 1, yy[i] - 1, ss);
	}

//	cout << "bfs: " << bfs();
//	exit(0);

	long long curr = MaxFlow();

//	cout << curr << endl;

	return (curr >= k);
}

int main()
{
 	#ifndef ONLINE_JUDGE
    freopen(fname"in", "r", stdin);
    freopen(fname"out", "w", stdout);
	#endif

	scanf("%d%d%d", &n, &m, &k);

	for (int i = 1; i <= m; ++ i) {
		scanf("%d%d%d", &xx[i], &yy[i], &zz[i]);
	}

	double l = 0, r = inf;

	for (int it = 0; it < 100; ++ it) {
		double mid = (l + r) / 2.0;
		if (ok(mid)) l = mid;
		else r = mid;
	}

	l *= k;
	printf("%.10f", l);

	return 0;
}


#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <vector>
#include <ctime>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <iomanip>
#include <fstream>
using namespace std;
#define fname ""
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define inf 1000000000

const int N = 550;
struct edge {
    ll from, to, cap, flow;
};
vector <edge> allEdges;
vector <int> edges[N];
int n;

void add(int x, int y, ll z) {
    edge e1 = {x, y, z, 0}, e2 = {y, x, 0, 0};
    edges[x].push_back((int)allEdges.size());
    allEdges.push_back(e1);
    edges[y].push_back((int)allEdges.size());
    allEdges.push_back(e2);
}

int nxt[N], block[N];

queue <int> q;

bool bfs() {
    memset(block, 0, sizeof block);
    block[0] = 1;
    q.push(0);
    while (!q.empty()) {
        int v = q.front();
        q.pop();
        for (int i = 0; i < (int)edges[v].size(); ++i) {
            int id = edges[v][i];
            if (!block[allEdges[id].to] && allEdges[id].cap > allEdges[id].flow) {
                block[allEdges[id].to] = block[v] + 1;
                q.push(allEdges[id].to);
            }
        }
    }
    return (block[n - 1] > 0);
}

int dfs(int v, int mn = inf) {
    if (!mn || v == n - 1) {
        return mn;
    }
    for (; nxt[v] < (int)edges[v].size(); ++nxt[v]) {
        int id = edges[v][nxt[v]];
        if (block[v] + 1 == block[allEdges[id].to] &&
            allEdges[id].cap - allEdges[id].flow > 0) {
            ll Min = min(mn + 0ll, allEdges[id].cap - allEdges[id].flow);
            ll cur = dfs(allEdges[id].to, Min);
            if (cur != 0) {
                allEdges[id].flow += cur;
                allEdges[id ^ 1].flow -= cur;
                return cur;
            }
        }
    }
    return 0;
}

long long MaxFlow() {
    long long flow = 0;
    while (bfs()) {
//	   cout << "asd";
       memset(nxt, 0, sizeof nxt);
       while (int pushed = dfs(0)) flow += pushed;
    }
    return flow;
}

int xx[777], yy[777], zz[777], m, k;

inline bool ok(double weight) {

//	for (int i = 0; i <= n; ++ i) edges[i].clear();
//	allEdges.clear();

	for (int i = 1; i <= m; ++ i) {
		ll ss = (double)zz[i] / weight;
//		cout << xx[i] << " " << yy[i] << " " << ss << endl;
		add(xx[i] - 1, yy[i] - 1, ss);
	}

//	cout << "bfs: " << bfs();
//	exit(0);

	long long curr = MaxFlow();

//	cout << curr << endl;

	return (curr >= k);
}

int main()
{
 	#ifndef ONLINE_JUDGE
    freopen(fname"in", "r", stdin);
    freopen(fname"out", "w", stdout);
	#endif

	scanf("%d%d%d", &n, &m, &k);

	for (int i = 1; i <= m; ++ i) {
		scanf("%d%d%d", &xx[i], &yy[i], &zz[i]);
	}

	double l = 0, r = inf;

	for (int it = 0; it < 100; ++ it) {
		double mid = (l + r) / 2.0;
		if (ok(mid)) l = mid;
		else r = mid;
	}

	l *= k;
	printf("%.10f", l);

	return 0;
}


#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <vector>
#include <ctime>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <iomanip>
#include <fstream>
using namespace std;
#define fname ""
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define inf 1000000

const int N = 550;
struct edge {
    ll from, to, cap, flow;
};
vector <edge> allEdges;
vector <int> edges[N];
ll n;

void add(int x, int y, ll z) {
    edge e1 = {x, y, z, 0}, e2 = {y, x, 0, 0};
    edges[x].push_back((int)allEdges.size());
    allEdges.push_back(e1);
    edges[y].push_back((int)allEdges.size());
    allEdges.push_back(e2);
}

ll nxt[N], block[N];

queue <ll> q;

bool bfs() {
    memset(block, 0, sizeof block);
    block[0] = 1;
    q.push(0);
    while (!q.empty()) {
        ll v = q.front();
        q.pop();
        for (ll i = 0; i < (int)edges[v].size(); ++i) {
            ll id = edges[v][i];
            if (!block[allEdges[id].to] && allEdges[id].cap > allEdges[id].flow) {
                block[allEdges[id].to] = block[v] + 1;
                q.push(allEdges[id].to);
            }
        }
    }
    return (block[n - 1] > 0);
}

ll dfs(ll v, ll mn = inf) {
    if (!mn || v == n - 1) {
        return mn;
    }
    for (; nxt[v] < (int)edges[v].size(); ++nxt[v]) {
        ll id = edges[v][nxt[v]];
        if (block[v] + 1 == block[allEdges[id].to] &&
            allEdges[id].cap - allEdges[id].flow > 0) {
            ll Min = min(mn + 0ll, allEdges[id].cap - allEdges[id].flow);
            ll cur = dfs(allEdges[id].to, Min);
            if (cur != 0) {
                allEdges[id].flow += cur;
                allEdges[id ^ 1].flow -= cur;
                return cur;
            }
        }
    }
    return 0;
}

long long MaxFlow() {
    long long flow = 0;
    while (bfs()) {
//	   cout << "asd";
       memset(nxt, 0, sizeof nxt);
       while (ll pushed = dfs(0)) flow += pushed;
    }
    return flow;
}

int xx[777], yy[777], zz[777], m, k;

inline bool ok(double weight) {

//	for (int i = 0; i <= n; ++ i) edges[i].clear();
//	allEdges.clear();

	for (int i = 1; i <= m; ++ i) {
		ll ss = (double)zz[i] / weight;
		ss = min(ss, inf + 0ll);
//		cout << xx[i] << " " << yy[i] << " " << ss << endl;
		add(xx[i] - 1, yy[i] - 1, ss);
	}

//	cout << "bfs: " << bfs();
//	exit(0);

	long long curr = MaxFlow();

//	cout << curr << endl;

	return (curr >= k);
}

int main()
{
 	#ifndef ONLINE_JUDGE
    freopen(fname"in", "r", stdin);
    freopen(fname"out", "w", stdout);
	#endif

	cin >> n >> m >> k;

	for (int i = 1; i <= m; ++ i) {
		cin >> xx[i] >> yy[i] >> zz[i];
	}

	double l = 0, r = inf;

	for (int it = 0; it < 100; ++ it) {
		double mid = (l + r) / 2.0;
		if (ok(mid)) l = mid;
		else r = mid;
	}

	l *= k;
	printf("%.10f", l);

	return 0;
}


#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <vector>
#include <ctime>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <iomanip>
#include <fstream>
using namespace std;
#define fname ""
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define inf 1000000000

const int N = 550;
struct edge {
    ll from, to, cap, flow;
};
vector <edge> allEdges;
vector <int> edges[N];
ll n;

void add(int x, int y, ll z) {
    edge e1 = {x, y, z, 0}, e2 = {y, x, 0, 0};
    edges[x].push_back((int)allEdges.size());
    allEdges.push_back(e1);
    edges[y].push_back((int)allEdges.size());
    allEdges.push_back(e2);
}

ll nxt[N], block[N];

queue <ll> q;

bool bfs() {
    memset(block, 0, sizeof block);
    block[0] = 1;
    q.push(0);
    while (!q.empty()) {
        ll v = q.front();
        q.pop();
        for (ll i = 0; i < (int)edges[v].size(); ++i) {
            ll id = edges[v][i];
            if (!block[allEdges[id].to] && allEdges[id].cap > allEdges[id].flow) {
                block[allEdges[id].to] = block[v] + 1;
                q.push(allEdges[id].to);
            }
        }
    }
    return (block[n - 1] > 0);
}

ll dfs(ll v, ll mn = INF) {
    if (!mn || v == n - 1) {
        return mn;
    }
    for (; nxt[v] < (int)edges[v].size(); ++nxt[v]) {
        ll id = edges[v][nxt[v]];
        if (block[v] + 1 == block[allEdges[id].to] &&
            allEdges[id].cap - allEdges[id].flow > 0) {
            ll Min = min(mn + 0ll, allEdges[id].cap - allEdges[id].flow);
            ll cur = dfs(allEdges[id].to, Min);
            if (cur != 0) {
                allEdges[id].flow += cur;
                allEdges[id ^ 1].flow -= cur;
                return cur;
            }
        }
    }
    return 0;
}

long long MaxFlow() {
    long long flow = 0;
    while (bfs()) {
//	   cout << "asd";
       memset(nxt, 0, sizeof nxt);
       while (ll pushed = dfs(0)) flow += pushed;
    }
    return flow;
}

int xx[777], yy[777], zz[777], m, k;

inline bool ok(double weight) {

//	for (int i = 0; i <= n; ++ i) edges[i].clear();
//	allEdges.clear();

	for (int i = 1; i <= m; ++ i) {
		ll ss = (double)zz[i] / weight;
		ss = min(ss, inf + 0ll);
//		cout << xx[i] << " " << yy[i] << " " << ss << endl;
		add(xx[i] - 1, yy[i] - 1, ss);
	}

//	cout << "bfs: " << bfs();
//	exit(0);

	long long curr = MaxFlow();

//	cout << curr << endl;

	return (curr >= k);
}

int main()
{
 	#ifndef ONLINE_JUDGE
    freopen(fname"in", "r", stdin);
    freopen(fname"out", "w", stdout);
	#endif

	scanf("%d%d%d", &n, &m, &k);

	for (int i = 1; i <= m; ++ i) {
		scanf("%d%d%d", &xx[i], &yy[i], &zz[i]);
	}

	double l = 0, r = inf;

	for (int it = 0; it < 100; ++ it) {
		double mid = (l + r) / 2.0;
		if (ok(mid)) l = mid;
		else r = mid;
	}

	l *= k;
	printf("%.10f", l);

	return 0;
}


#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <vector>
#include <ctime>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <iomanip>
#include <fstream>
using namespace std;
#define fname ""
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define inf 1000000

const int N = 550;
struct edge {
    ll from, to, cap, flow;
};
vector <edge> allEdges;
vector <ll> edges[N];
ll n;

void add(ll x, ll y, ll z) {
    edge e1 = {x, y, z, 0}, e2 = {y, x, 0, 0};
    edges[x].push_back((int)allEdges.size());
    allEdges.push_back(e1);
    edges[y].push_back((int)allEdges.size());
    allEdges.push_back(e2);
}

ll nxt[N], block[N];

queue <ll> q;

bool bfs() {
    memset(block, 0, sizeof block);
    block[0] = 1;
    q.push(0);
    while (!q.empty()) {
        ll v = q.front();
        q.pop();
        for (ll i = 0; i < (int)edges[v].size(); ++i) {
            ll id = edges[v][i];
            if (!block[allEdges[id].to] && allEdges[id].cap > allEdges[id].flow) {
                block[allEdges[id].to] = block[v] + 1;
                q.push(allEdges[id].to);
            }
        }
    }
    return (block[n - 1] > 0);
}

ll dfs(ll v, ll mn = inf) {
    if (!mn || v == n - 1) {
        return mn;
    }
    for (; nxt[v] < (ll)edges[v].size(); ++nxt[v]) {
        ll id = edges[v][nxt[v]];
        if (block[v] + 1 == block[allEdges[id].to] &&
            allEdges[id].cap - allEdges[id].flow > 0) {
            ll Min = min(mn + 0ll, allEdges[id].cap - allEdges[id].flow);
            ll cur = dfs(allEdges[id].to, Min);
            if (cur != 0) {
                allEdges[id].flow += cur;
                allEdges[id ^ 1].flow -= cur;
                return cur;
            }
        }
    }
    return 0;
}

long long MaxFlow() {
    long long flow = 0;
    while (bfs()) {
//	   cout << "asd";
       memset(nxt, 0, sizeof nxt);
       while (ll pushed = dfs(0)) flow += pushed;
    }
    return flow;
}

ll xx[777], yy[777], zz[777], m, k;

inline bool ok(double weight) {

//	for (int i = 0; i <= n; ++ i) edges[i].clear();
//	allEdges.clear();

	for (int i = 1; i <= m; ++ i) {
		ll ss = min((double)zz[i] / weight,	(double)k);
//		cout << xx[i] << " " << yy[i] << " " << ss << endl;
		add(xx[i] - 1, yy[i] - 1, ss);
	}

//	cout << "bfs: " << bfs();
//	exit(0);

	long long curr = MaxFlow();

//	cout << curr << endl;

	return (curr >= k);
}

int main()
{
 	#ifndef ONLINE_JUDGE
    freopen(fname"in", "r", stdin);
    freopen(fname"out", "w", stdout);
	#endif

	cin >> n >> m >> k;

	for (int i = 1; i <= m; ++ i) {
		cin >> xx[i] >> yy[i] >> zz[i];
	}

	double l = 0, r = inf;

	for (int it = 0; it < 200; ++ it) {
		double mid = (l + r) / 2.0;
		if (ok(mid)) l = mid;
		else r = mid;
	}

	l *= k;
	printf("%.10f", l);

	return 0;
}


#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <bitset>
#include <deque>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef long long ll;
#define mset(a,b) memset(a,b,sizeof a)
#define pb push_back
#define mp make_pair
typedef vector<ll> vll;
#define N 70
#define inf (1<<30)
#define EPS 1e-10
vi graph[N], extra;
int bears, n, P[N], dist[N], cost[N][N], cpy[N][N];
bool bfs(){
    for(auto &it:dist) it = inf;
    queue<int> fila;
    dist[1] = 0;
    P[1] = -1;
    fila.push(1);
    while(!fila.empty()){
        int cur = fila.front();
        fila.pop();
        for(auto it:graph[cur]){
            if(!cost[cur][it]) continue;
            if(dist[it] > dist[cur] + 1){
                dist[it] = dist[cur] + 1;
                P[it] = cur;
                fila.push(it);
            }
        }
    }
    return dist[n] != inf;
}
int augment(int cur, int mi){
    if(P[cur] == -1) return mi;
    int f = augment(P[cur], min(mi, cost[P[cur]][cur]));
    cost[P[cur]][cur] -= f;
    cost[cur][P[cur]] += f;
    return f;
}
int flow(double lim){
    for(int e = 0; e < N; e++) for(int f = 0; f < N; f++) cpy[e][f] = cost[e][f], cost[e][f] /= lim;
    int ans = 0;
    while(bfs())
        ans += augment(n, inf);
    for(int e = 0; e < N; e++) for(int f = 0; f < N; f++) cost[e][f] = cpy[e][f];
    return ans;
}
int main(){
    int m, x, y;
    ll c;
    scanf("%d %d %d", &n, &m, &bears);
    while(m--){
        scanf("%d %d %lld", &x, &y, &c);
        cost[x][y] = c;
        graph[x].pb(y);
    }
    double lo = 0, hi = 1e9;
    while(hi - lo > EPS){
        //cout << "aqui" << endl;
        double mid = (lo+hi)*0.5;
        if(flow(mid) >= bears) lo = mid;
        else hi = mid;
    }
    printf("%.10lf\n", lo*bears);
    return 0;
}

// 1481927265056


#include<bits/stdc++.h>

using namespace std;

void arquivo(){
    freopen("in","r",stdin);
}

const int oo = 0x3f3f3f3f;
const double EPS = 1e-9;
long long n,m,x,u,v,w,res[55][55],mf,f;
long long s;
vector<int> p;
map<long long,long long> mapa;

void augment(int v,int minEdge){
    if(v == 1){ f = minEdge; return ;}
    else if(p[v] != -1){
        augment(p[v],min(minEdge,res[p[v]][v]));
        res[p[v]][v] -= f;
        res[v][p[v]] += f;
    }
}

int main(){
    scanf("%lld%lld%lld",&n,&m,&x);
    for(int i=0;i<m;i++){
        scanf("%lld%lld%lld",&u,&v,&w);
        res[u][v] = w;
    }
    mf = 0;
    while(1){
        f = 0;
        vector<int> dist(55,oo);
        dist[1] = 0;
        queue<int> q;
        q.push(1);
        p.assign(55,-1);
        while(!q.empty()){
            int u = q.front(); q.pop();
            if(u == n) break;
            for(int v=1;v<=n;v++){
                if(res[u][v] > 0 && dist[v] == oo){
                    dist[v] = dist[u] + 1, q.push(v) , p[v] = u;
                }
            }
        }
        augment(n,oo);
        if(f == 0){

            break;
        }
        mapa[f]++;
        mf += f;
    }
    double l = 0, r = (double)mf/(double)x, mid ;
    for(int i=0;i<1000;i++){
        mid = (l+r)/2;

        if(mid <= EPS){
            mid = 0;
            break;
        }
        s = 0;
        for(map<int,int>::iterator it = mapa.begin();it!=mapa.end();it++){
            s += ((long long) ((double)it->first / (double)mid) ) * it->second;
        }
        if(s < x){
            r = mid;
        }
        else if (s >= x){
            l = mid;
        }

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

// 1469559462177


#include <cstring>
#include <iostream>
#include <bitset>
#include <cstdlib>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>
#include <utility>
#include <algorithm>
#include <iomanip>
using namespace std;
#define sc(a) scanf("%d", &a)
#define sc2(a, b) scanf("%d%d", &a, &b)
#define sc3(a, b, c) scanf("%d%d%d", &a, &b, &c)
#define scs(s) scanf("%s", s)
#define pri(x) printf("%d\n", x)
#define prie(x) printf("%d ", x)
#define mp make_pair
#define pb push_back
#define BUFF ios::sync_with_stdio(false);
#define imprime(v)                                        \
  for (int X = 0; X < v.size(); X++) cout << v[X] << " "; \
  cout << endl;
#define grid(v)                                                   \
  for (int X = 0; X < v.size(); X++) {                            \
    for (int Y = 0; Y < v[X].size(); Y++) cout << v[X][Y] << " "; \
    cout << endl;                                                 \
  }
#define endl "\n"
const int INF = 0x3f3f3f3f;
const long double pi = acos(-1);
typedef long long int ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vector<int> > vvi;
typedef vector<vector<ii> > vvii;
const int MOD = 1e9 + 7;
struct Edge {
  int at, where;
  ll cap;
  void init(int _at, ll _cap, int _where)
  {
    at = _at, cap = _cap, where = _where;
  }
};
struct dad {
  int at, up, down;
  dad() { at = -1; }
  dad(int _at, int _up, int _down) { at = _at, up = _up, down = _down; }
};
class MaxFlow {
 private:
  vector<vector<Edge> > g;
  ll mf, f;
  int s, t;
  vector<dad> p;

 public:
  MaxFlow(int N) { init(N); }
  void augment(int v, ll minEdge)
  {
    if (v == s) {
      f = minEdge;
      return;
    }
    else if (p[v].at != -1) {
      augment(p[v].at, min(minEdge, g[p[v].at][p[v].up].cap));
      g[p[v].at][p[v].up].cap -= f;
      g[v][p[v].down].cap += f;
    }
  }
  void init(int N)
  {
    for (int i = 0; i < g.size(); i++) g[i].clear();
    mf = 0, f = 0;
    g.resize(N);
  }
  void addEdge(int u, int v, ll cap)
  {
    Edge A;
    A.init(v, cap, g[v].size());
    Edge B;
    B.init(u, 0, g[u].size());
    g[u].pb(A);
    g[v].pb(B);
  }
  int maxFlow(int source, int sink)
  {
    s = source;
    t = sink;
    mf = 0;
    while (true) {
      f = 0;
      vector<int> dist(g.size(), INF);
      dist[s] = 0;
      queue<int> q;
      q.push(s);
      p.clear();
      p.resize(g.size());
      while (!q.empty()) {
        int u = q.front();
        q.pop();
        if (u == t) break;
        for (int i = 0; i < g[u].size(); i++) {
          Edge prox = g[u][i];
          if (dist[prox.at] == INF and prox.cap > 0) {
            dist[prox.at] = dist[u] + 1;
            q.push(prox.at);
            dad paizao(u, i, prox.where);
            p[prox.at] = paizao;
          }
        }
      }
      augment(t, INF);
      if (f == 0) break;
      mf += f;
    }
    return mf;
  }
};
ll u[51], v[51], w[51];
ll n, m, k;
bool simula(double x)
{
  MaxFlow g(n + 10);
  for (int i = 0; i < m; i++) g.addEdge(u[i], v[i], w[i] / x);

  ll f = g.maxFlow(1, n);
  if (f >= k) return true;
  return false;
}
double bb(double b, double e)
{
  for (int i = 0; i < 100; i++) {
    double m = (b + e) / 2.0;
    if (simula(m))
      b = m;
    else
      e = m;
  }
  return b;
}
int main()
{
  BUFF;
  cin >> n >> m >> k;
  for (int i = 0; i < m; i++) cin >> u[i] >> v[i] >> w[i];
  double resp = bb(0, 20000000000.0);
  resp = resp * 1.0 * k;
  cout << setprecision(11) << fixed << resp << endl;
  return 0;
}

// 1470096128371


#include<bits/stdc++.h>

using namespace std;

void arquivo(){
    freopen("in","r",stdin);
}

const long long oo = 0x3f3f3f3f;
const double EPS = 1e-6;
long long n,m,x,u,v,w,res[55][55],mf,f;
long long s;
vector<long long> p;
map<long long,long long> mapa;

void augment(long long v,long long minEdge){
    if(v == 1){ f = minEdge; return ;}
    else if(p[v] != -1){
        augment(p[v],min(minEdge,res[p[v]][v]));
        res[p[v]][v] -= f;
        res[v][p[v]] += f;
    }
}

int  main(){
    scanf("%lld%lld%lld",&n,&m,&x);
    for(long long i=0;i<m;i++){
        scanf("%lld%lld%lld",&u,&v,&w);
        res[u][v] = w;
    }
    mf = 0;
    while(1){
        f = 0;
        vector<long long> dist(55,oo);
        dist[1] = 0;
        queue<long long> q;
        q.push(1);
        p.assign(55,-1);
        while(!q.empty()){
            long long u = q.front(); q.pop();
            if(u == n) break;
            for(long long v=1;v<=n;v++){
                if(res[u][v] > 0 && dist[v] == oo){
                    dist[v] = dist[u] + 1, q.push(v) , p[v] = u;
                }
            }
        }
        augment(n,oo);
        if(f == 0){

            break;
        }
        mapa[f]++;
        mf += f;
    }
    double l = 0, r = (double)mf/(double)x, mid=0;
    for(long long i=0;i<1000;i++){
        mid = (l+r)/2;
        if(mid <= EPS){
            break;
        }
        s = 0;
        for(map<long long,long long>::iterator it = mapa.begin();it!=mapa.end();it++){
            s += ((long long) ((double)it->first / (double)mid)) * it->second;
        }
        if(s < x){
            r = mid;
        }
        else if (s >= x){
            l = mid;
        }

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

// 1469560575296


#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;

vector<tuple<int, int, int> >edges;
struct CostFlowGraph {
    struct Edge {
        int v;
        long long cap;
        int cst;
        Edge(int _v, long long _cap, int _cst) : v(_v), cap(_cap), cst(_cst) {}
    };
    int V;
    vector<Edge> edges;
    vector<vector<int>> adj;

    CostFlowGraph(int _V) : V(_V) { adj.resize(V); }

    void add_edge(int u, int v, long long cap, int cst) {
        adj[u].push_back(edges.size());
        edges.push_back(Edge(v, cap, cst));
        adj[v].push_back(edges.size());
        edges.push_back(Edge(u, 0, -cst));
    }
};
struct MinCostMaxFlowSSP {
    CostFlowGraph &g;
    vector<long long> d, p;

    MinCostMaxFlowSSP(CostFlowGraph &_g) : g(_g) {
        d.resize(g.V);
        p.resize(g.V);
    }

    void init_p(int s) {
        fill(d.begin(), d.end(), oo);
        d[s] = 0;
        queue<int> q({s});
        vector<bool> queued(g.V, 0);
        while (!q.empty()) {
            int v = q.front();
            q.pop();
            queued[v] = 0;
            for (int i: g.adj[v]) {
                int w = g.edges[i].v;
                if (!g.edges[i].cap) continue;
                if (d[w] > d[v] + g.edges[i].cst) {
                    d[w] = d[v] + g.edges[i].cst;
                    if (!queued[w]) {
                        q.push(w);
                        queued[w] = 1;
                    }
                }
            }
        }
        for (int v = 0; v < g.V; v++)
            p[v] = d[v];
    }

    pair<long long, int> augment(int s, int t) {
        fill(d.begin(), d.end(), oo);
        d[s] = 0;
        vector<bool> done(g.V, 0);
        vector<long long> prv(g.V, -1), flow(g.V);
        flow[s] = oo;
        while (1) {
            int v;
            int dist_v = oo;
            for (int w = 0; w < g.V; w++) {
                if (!done[w] && d[w] < dist_v) {
                    v = w;
                    dist_v = d[w];
                }
            }
            if (dist_v == oo) break;
            for (int i: g.adj[v]) {
                int w = g.edges[i].v;
                long long cap = g.edges[i].cap, cst = g.edges[i].cst;
                if (cap && d[w] > d[v] + cst + p[v] - p[w]) {
                    d[w] = d[v] + cst + p[v] - p[w];
                    prv[w] = i;
                    flow[w] = min(flow[v], cap);
                }
            }
            done[v] = 1;
        }
        if (d[t] == oo) return make_pair(-1, 0);
        for (int v = 0; v < g.V; v++) p[v] += d[v];

        long long flow_cost = 0;
        for (int v = t; v != s; v = g.edges[prv[v]^1].v) {
            g.edges[prv[v]].cap -= flow[t];
            g.edges[prv[v]^1].cap += flow[t];
            flow_cost += flow[t] * g.edges[prv[v]].cst;
        }
        return make_pair(flow[t], flow_cost);
    }

    // Returns a pair (max flow, min cost)
    pair<int, int> mcmf(int s, int t) {
        pair<int, int> ret(0, 0), aug;
        init_p(s);
        while ((aug = augment(s, t)).first != -1) {
            ret.first += aug.first;
            ret.second += aug.second;
        }
        return ret;
    }
};
int check(double mid, int n) {
    CostFlowGraph graph(n+1);
    for(int i = 0; i < edges.size(); ++i){
        graph.add_edge(get<0>(edges[i]), get<1>(edges[i]), get<2>(edges[i])/mid, 0);
    }
    MinCostMaxFlowSSP mcmf(graph);
    return mcmf.mcmf(1, n).first;
}
int main() {

    int n, m, x;
    int u, v, w;
    scanf("%d %d %d", &n, &m, &x);
    for(int i = 0; i < m; ++i){
        scanf("%d %d %d", &u, &v, &w);
        edges.push_back(make_tuple(u, v, w));
    }
    double lf = 0;
    double rg = 100000000;
    for(int i = 0; i < 1000; ++i){
        double mid = (lf+rg)/2;
        if(check(mid, n) >= x)lf = mid;
        else rg = mid;
    }
    printf("%.10lf\n", lf*x);
    return 0;
}
// 1514281152478


#include <cstring>
#include <iostream>
#include <bitset>
#include <cstdlib>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>
#include <utility>
#include <algorithm>
#include <iomanip>
#define BUFF ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define mp make_pair
#define pb push_back
#define imprime(v)                                        \
  for (int X = 0; X < v.size(); X++) cout << v[X] << " "; \
  cout << endl;
#define grid(v)                                                   \
  for (int X = 0; X < v.size(); X++) {                            \
    for (int Y = 0; Y < v[X].size(); Y++) cout << v[X][Y] << " "; \
    cout << endl;                                                 \
  }
#define endl "\n"
#define double long double
using namespace std;
typedef pair<int, int> ii;
const int INF = 0x3f3f3f3f;
typedef long long int ll;
struct Edge {
  int at,where;
  ll cap;
  void init(int _at, ll _cap, int _where) { at = _at, cap = _cap, where = _where; }
};
struct dad {
  int at, up, down;
  dad() {at=-1;}
  dad(int _at, int _up, int _down) { at = _at, up = _up, down = _down; }
};
class MaxFlow {
 private:
  vector<vector<Edge> > g;
  ll mf, f;
  int s, t;
  vector<dad> p;

 public:
  void augment(int v, ll minEdge)
  {
    if (v == s) {
      f = minEdge;
      return;
    }
    else if (p[v].at != -1) {
      augment(p[v].at, min(minEdge, g[p[v].at][p[v].up].cap));
      g[p[v].at][p[v].up].cap -= f;
      g[v][p[v].down].cap += f;
    }
  }
  void init(int N)
  {
    for (int i = 0; i < g.size(); i++) g[i].clear();
    mf = 0, f = 0;
    g.resize(N);
  }
  void addEdge(int u, int v, ll cap)
  {
    Edge A;
    A.init(v, cap, g[v].size());
    Edge B;
    B.init(u, 0, g[u].size());
    g[u].pb(A);
    g[v].pb(B);
  }
  int maxFlow(int source, int sink)
  {
    s = source;
    t = sink;
    mf = 0;
    while (true) {
      f = 0;
      vector<int> dist(g.size(), INF);
      dist[s] = 0;
      queue<int> q;
      q.push(s);
      p.clear();
      p.resize(g.size());
      while (!q.empty()) {
        int u = q.front();
        q.pop();
        if (u == t) break;
        for (int i = 0; i < g[u].size(); i++) {
          Edge prox = g[u][i];
          if (dist[prox.at] == INF and prox.cap > 0) {
            dist[prox.at] = dist[u] + 1;
            q.push(prox.at);
            dad paizao(u, i, prox.where);
            p[prox.at] = paizao;
          }
        }
      }
      augment(t, INF);
      if (f == 0) break;
      mf += f;
    }
    return mf;
  }
};

ll n, m, x;
vector< pair<int, pair<ll,int> > > cu;
MaxFlow graph;
double bb(double i, double f)
{
  if (f - i < 1e-12) return i;
  MaxFlow graph;
  graph.init(n+1);
  double meio = (i + f) / (double)2;
  for (ll i = 0; i < cu.size(); i++) {
    ll u, v;
    ll cap;
    u = cu[i].first;
    v = cu[i].second.first;
    cap = cu[i].second.second;
    cap = cap / meio;
    graph.addEdge(u, v, (ll)cap);
  }
  double resp = graph.maxFlow(1, n);
  if (resp >= x) return bb(meio, f);
  return bb(i, meio);
}
int main()
{
  cin >> n >> m >> x;
  for (ll i = 0; i < m; i++) {
    ll u, v, cap;
    cin >> u >> v >> cap;
    pair<int, pair<int,ll> > xablau;
    xablau.first = u;
    xablau.second.first = v;
    xablau.second.second = cap;
    cu.pb(xablau);
  }
  double r = bb(0, 100000000);
  r *= (double)x;
  cout << setprecision(10) << fixed << r << endl;
  return 0;
}

// 1469554289732


#include<bits/stdc++.h>

using namespace std;

void arquivo(){
    freopen("in","r",stdin);
}

const long long oo = 0x3f3f3f3f;
const long double EPS = 1e-6;
long long n,m,x,u,v,w,res[55][55],mf,f;
long long s;
vector<long long> p;
map<long long,long long> mapa;

void augment(long long v,long long minEdge){
    if(v == 1){ f = minEdge; return ;}
    else if(p[v] != -1){
        augment(p[v],min(minEdge,res[p[v]][v]));
        res[p[v]][v] -= f;
        res[v][p[v]] += f;
    }
}

int  main(){
    scanf("%lld%lld%lld",&n,&m,&x);
    for(long long i=0;i<m;i++){
        scanf("%lld%lld%lld",&u,&v,&w);
        res[u][v] = w;
    }
    mf = 0;
    while(1){
        f = 0;
        vector<long long> dist(55,oo);
        dist[1] = 0;
        queue<long long> q;
        q.push(1);
        p.assign(55,-1);
        while(!q.empty()){
            long long u = q.front(); q.pop();
            if(u == n) break;
            for(long long v=1;v<=n;v++){
                if(res[u][v] > 0 && dist[v] == oo){
                    dist[v] = dist[u] + 1, q.push(v) , p[v] = u;
                }
            }
        }
        augment(n,oo);
        if(f == 0){
            break;
        }
        mapa[f]++;
        mf += f;
    }
    long double l = 0, r = (long double)mf/(long double)x, mid=0;
    for(long long i=0;i<1000;i++){
        mid = (l+r)/2;
      /* if(mid <= EPS){
            break;
        } */
        s = 0;
        for(map<long long,long long>::iterator it = mapa.begin();it!=mapa.end();it++){
            s += ((long long) ((long double)it->first / (long double)mid)) * it->second;
        }
        if(s < x){
            r = mid;
        }
        else if (s >= x){
            l = mid;
        }

    }
    printf("%.10Lf\n",x*mid);
    return 0;
}

// 1469624991480


#include<bits/stdc++.h>

using namespace std;

void arquivo(){
    freopen("in","r",stdin);
}

const long long oo = 0x3f3f3f3f;
const double EPS = 1e-9;
long long n,m,x,u,v,w,res[55][55],mf,f;
long long s;
vector<long long> p;
map<long long,long long> mapa;

void augment(long long v,long long minEdge){
    if(v == 1){ f = minEdge; return ;}
    else if(p[v] != -1){
        augment(p[v],min(minEdge,res[p[v]][v]));
        res[p[v]][v] -= f;
        res[v][p[v]] += f;
    }
}

int  main(){
    scanf("%lld%lld%lld",&n,&m,&x);
    for(long long i=0;i<m;i++){
        scanf("%lld%lld%lld",&u,&v,&w);
        res[u][v] = w;
    }
    mf = 0;
    while(1){
        f = 0;
        vector<long long> dist(55,oo);
        dist[1] = 0;
        queue<long long> q;
        q.push(1);
        p.assign(55,-1);
        while(!q.empty()){
            long long u = q.front(); q.pop();
            if(u == n) break;
            for(long long v=1;v<=n;v++){
                if(res[u][v] > 0 && dist[v] == oo){
                    dist[v] = dist[u] + 1, q.push(v) , p[v] = u;
                }
            }
        }
        augment(n,oo);
        if(f == 0){

            break;
        }
        mapa[f]++;
        mf += f;
    }
    double l = 0, r = (double)mf/(double)x, mid ;
    for(long long i=0;i<10000;i++){
        mid = (l+r)/2;

        if(mid <= EPS){
            mid = 0;
            break;
        }
        s = 0;
        for(map<long long,long long>::iterator it = mapa.begin();it!=mapa.end();it++){
            s += ((long long) ((double)it->first / (double)mid) ) * it->second;
        }
        if(s < x){
            r = mid;
        }
        else if (s >= x){
            l = mid;
        }

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

// 1469559725697


#include<bits/stdc++.h>
#define sc scanf
#define pt printf
#define fi first
#define pb push_back
#define se second
#define fr(i, a, b) for(int i = a; i < b; ++i)
#define cl(x, n) memset(x, n, sizeof x)
#define rp(i, u) for(int i = adj[u]; i != -1; i = ant[i])
#define crp(i, u) for(int &i = cadj[u]; i != -1; i = ant[i])

using namespace std;

typedef pair<int, int> ii;
typedef long long ll;

#define MAXN 100
#define MAXM 10000
#define src 0
#define snk (n-1)

int to[MAXM], ant[MAXM], adj[MAXN], cadj[MAXN], lvl[MAXN], z, n, m, p;
ll cap[MAXM], ccap[MAXM];

int add(int u, int v, ll c){
	to[z] = v, cap[z] = c, ant[z] = adj[u]; adj[u] = z++;
	to[z] = u, cap[z] = 0, ant[z] = adj[v]; adj[v] = z++;
}

int bfs(ll bas){
	cl(lvl, -1);
	lvl[src] = 0;
	queue<int> q;
	q.push(src);
	while(!q.empty()){
		int u = q.front(); q.pop();
		rp(i, u) if(cap[i] && cap[i] >= (cap[i]/bas)*bas && ((cap[i]/bas)*bas > 0) && lvl[to[i]] == -1) {
			lvl[to[i]] = lvl[u] + 1;
			q.push(to[i]);
		}
	}
	return lvl[snk] != -1;
}

ll dfs(int u, ll bas, ll df){
	if(u == snk) return df;
	ll f = 0;
	crp(i, u) if((cap[i]/bas)*bas > 0 && lvl[to[i]] == lvl[u] + 1 && (f = dfs(to[i], bas, min(df,(cap[i]/bas)*bas)))){
		cap[i] -= f, cap[i^1] += f;
		return f;
	}
	return 0;
}

ll mf(ll bas){
	ll ans = 0, f, df = bas*p;
	while(bfs(bas) && df){
		memcpy(cadj, adj, sizeof adj);
		//pt("o\n");
		while(f = dfs(src, bas, df)) { ans += f; df -= f;}
	}
	if(ans/bas < p) return -1;
	return ans;
}

#define M 1000000000000
int main(){
	cl(adj, -1), z = 0;
	sc("%d %d %d", &n, &m, &p);
	fr(i, 0, m){
		int a, b, x;
		sc("%d %d %d", &a, &b, &x);
		a--; b--;
		add(a, b, x*M);
	}
	memcpy(ccap, cap, sizeof cap);
	ll l = 1, r = 1000000000000000000;
	while(r-l > 1){
		memcpy(cap, ccap, sizeof ccap);
		ll m = (l+r)/2;
		//pt("%lld %lld\n", l, r);
		if(mf(m) != -1) l = m;
		else r = m;
	}
	memcpy(cap, ccap, sizeof ccap);
	ll ans = mf(r);
	if(ans == -1){
		memcpy(cap, ccap, sizeof ccap);
		ans = mf(l);
	}
	pt("%.10lf\n", (double)ans/M);

	return 0;
}
// 1472778342988


#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <bitset>
#include <deque>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef long long ll;
#define mset(a,b) memset(a,b,sizeof a)
#define pb push_back
#define mp make_pair
typedef vector<ll> vll;
#define N 60
#define inf (1<<30)
#define EPS 1e-9
vi graph[N], extra;
int bears, n, P[N], dist[N], cost[N][N], cpy[N][N];
bool bfs(){
    for(auto &it:dist) it = inf;
    queue<int> fila;
    dist[1] = 0;
    P[1] = -1;
    fila.push(1);
    while(!fila.empty()){
        int cur = fila.front();
        fila.pop();
        for(auto it:graph[cur]){
            if(!cost[cur][it]) continue;
            if(dist[it] > dist[cur] + 1){
                dist[it] = dist[cur] + 1;
                P[it] = cur;
                fila.push(it);
            }
        }
    }
    return dist[n] != inf;
}
int augment(int cur, int mi){
    if(P[cur] == -1) return mi;
    int f = augment(P[cur], min(mi, cost[P[cur]][cur]));
    cost[P[cur]][cur] -= f;
    cost[cur][P[cur]] += f;
    return f;
}
int flow(double lim){
    for(int e = 0; e < N; e++) for(int f = 0; f < N; f++) cpy[e][f] = cost[e][f], cost[e][f] /= lim;
    int ans = 0;
    while(bfs())
        ans += augment(n, inf);
    for(int e = 0; e < N; e++) for(int f = 0; f < N; f++) cost[e][f] = cpy[e][f];
    return ans;
}
int main(){
    int m, x, y;
    ll c;
    scanf("%d %d %d", &n, &m, &bears);
    while(m--){
        scanf("%d %d %lld", &x, &y, &c);
        cost[x][y] = c;
        graph[x].pb(y);
    }
    double lo = 0, hi = 1e6;
    int cont = 0;
    while(hi - lo > EPS && cont < N){
        cont++;
        //cout << "aqui" << endl;
        double mid = (lo+hi)*0.5;
        if(flow(mid) >= bears) lo = mid;
        else hi = mid;
    }
    printf("%.10lf\n", hi*bears);
    return 0;
}

// 1481929098190


#include <bits/stdc++.h>
#define f(a,b,c) for(int a=b;a<c;a++)
#define scnaf scanf
#define frg(a,b) for(int a=adj[b];~a;a=ant[a])
using namespace std;
typedef long long ll;
ll to[5100000],cap[5100000],ant[5100000],adj[60],z;
int n,m,brs;
void insert(int a,int b,ll c=1){
	//cout<<"\t"<<a<<","<<b<<endl;
	ant[z]=adj[a];
	cap[z]=c;
	to[z]=b;
	adj[a]=z++;
	ant[z]=adj[b];
	cap[z]=0;
	to[z]=a;
	adj[b]=z++;
}
ll level[60],fila[900000],copy_adj[60];
int bfs(int source,int sink){
	//cout<<"b";
	memset(level,-1,sizeof level);
	level[source]=0;
	int pos=0,tam=0;
	fila[tam++]=source;
	//cout<<"bfs\n";
	while(pos<tam){
		int now=fila[pos++];
		//cout<<"# - "<<now<<endl;
		frg(i,now){
			if(cap[i]&&level[to[i]]==-1){
				level[to[i]]=level[now]+1;
				fila[tam++]=to[i];
			}
		}
	}
	return ~level[sink];
}
ll dfs(int no,int sink,ll flow){
	//cout<<"d";
	if(no==sink)return flow;
	for(ll &i=copy_adj[no];~i;i=ant[i]){
		if(cap[i]&&level[no]+1==level[to[i]]){
			ll nflow=dfs(to[i],sink,min(flow,cap[i]));
			if(nflow){
				cap[i]-=nflow;cap[i^1]+=nflow;
				return nflow;
			}
		}
	}
	return 0;
}
ll dinic(int source,int sink){
	ll mf=0,add;//cout<<"dinic\n";
	while(bfs(source,sink)){
		memcpy(copy_adj,adj,sizeof adj);
		while(add=dfs(source,sink,10000)){
			mf+=add;
		}
	}
	//cout<<"oi";
	return mf;
}
double lido[600];int lidoa[600][2];
bool can(double x){
	z=0;memset(adj,-1,sizeof adj);
	f(i,0,m){
		insert(lidoa[i][0],lidoa[i][1],ll(lido[i]/x));
	}
	if(dinic(1,n)>=brs)return true;
	return false;
}
double bs(){
	double l=0,r=10000000.0,iter=500;
	while(iter--){
		double m=(l+r)/2.0;
		if(can(m))l=m;
		else r=m;
	}
	return r*double(brs);
}
int main(){
	int sz=z;int aa,bb;double cc;int needed=1000000,cse=1;
	scanf("%d%d%d",&n,&m,&brs);
	f(i,0,m){
		scanf("%d%d%lf",&aa,&bb,&cc);
		lido[i]=cc;
		lidoa[i][0]=aa;
		lidoa[i][1]=bb;
	}
	printf("%.8lf\n",bs());
}
// 1473711400691


#include <bits/stdc++.h>

#define debug(x) cout << #x << " = " << x << endl
#define fori(i, ini, lim) for(int i = int(ini); i < int(lim); i++)
#define ford(i, ini, lim) for(int i = int(ini); i >= int(lim); i--)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;

int N, M, X;
vector<int> adj[55];
ll cap_ori[55][55];
ll cap_var[55][55];
bool visited[55];
int from[55];

ll bfs() {
	memset(visited, false, sizeof visited);
	memset(from, -1, sizeof from);
	queue<int> q;
	q.push(1);
	visited[1] = true;
	bool found = false;
	while(!found && !q.empty()) {
		auto cur = q.front(); q.pop();

		for(auto each : adj[cur]) {
			if(!visited[each] && cap_var[cur][each] > 0) {
				visited[each] = true;
				from[each] = cur;
				if(each == N) {
					found = true;
					break;
				}
				q.push(each);
			}
		}
	}

	int cur = N;
	ll pc = 1LL << 60;
	while(from[cur] != -1) {
		int prev = from[cur];
		pc = min(pc, (ll) cap_var[prev][cur]);
		cur = prev;
	}

	cur = N;
	while(from[cur] != -1) {
		int prev = from[cur];
		cap_var[prev][cur] -= pc;
		cap_var[cur][prev] += pc;
		cur = prev;
	}

	return (pc == (1LL << 60)) ? 0 : pc;
}

bool has_edge[55][55];

ll max_flow() {
	ll mf = 0;
	ll pc = 0;
	do {
		pc = bfs();
		mf += pc;
	} while(pc > 0);
	return mf;
}

bool check(ld weight) {
	memset(cap_var, 0, sizeof cap_var);
	ld single_weight = weight / X;
	fori(i, 1, N + 1) {
		for(auto each : adj[i]) {
			if(has_edge[i][each]) {
				cap_var[i][each] = cap_ori[i][each] / single_weight;
			}
		}
	}

	ll mf = max_flow();
	return(mf >= X);
}

int main() {
	ios_base::sync_with_stdio(false);

	memset(has_edge, false, sizeof has_edge);
	cin >> N >> M >> X;
	fori(i, 0, M) {
		int a, b, c;
		cin >> a >> b >> c;
		adj[a].push_back(b);
		adj[b].push_back(a);
		cap_ori[a][b] = c;
		has_edge[a][b] = true;
	}

	ld left = 0, right = 1e18;
	ld mid = (left + right) / 2;
	fori(i, 0, 100) {
		mid = (left + right) / 2;
		if(check(mid)) {
			left = mid;
		}
		else {
			right = mid;
		}
	}

	cout << fixed << setprecision(10) << mid << '\n';

	return 0;
}
// 1469562627359


#include <bits/stdc++.h>

using namespace std;

const double eps = 1e-7;

const int inf = 0x3f3f3f3f;
const int N = 55000, E = 4000000;

int cmp(double a, double b) {
  if (fabs(a - b) < eps) return 0;
  return a < b ? -1 : 1;
}

int to[E], cap[E], ant[E], adj[N], inde;
int level[N], fila[N], copy_adj[N];

inline void add_edge(int a, int b, int c) {
  to[inde] = b; cap[inde] = c; ant[inde] = adj[a]; adj[a] = inde++;
  to[inde] = a; cap[inde] = 0; ant[inde] = adj[b]; adj[b] = inde++;
}

int bfs(int source, int sink) {
  memset(level, -1, sizeof level);
  level[source] = 0;
  int front = 0, size = 0, v;
  fila[size++] = source;
  while (front < size) {
    v = fila[front++];
    for (int i = adj[v]; ~i; i = ant[i]) {
      if (cap[i] && level[to[i]] == -1) {
        level[to[i]] = level[v] + 1;
        fila[size++] = to[i];
      }
    }
  }
  return level[sink] != -1;
}

int dfs(int v, int sink, int flow) {
  if (v == sink) return flow;
  int f;
  for (int &i = copy_adj[v]; ~i; i = ant[i]) {
    if (cap[i] && level[to[i]] == level[v] + 1 && (f = dfs(to[i], sink, min(flow, cap[i])))) {
      cap[i] -= f; cap[i ^ 1] += f;
      return f;
    }
  }
  return 0;
}

int maxflow(int source, int sink) {
  int ret = 0, flow;
  while (bfs(source, sink)) {
    memcpy(copy_adj, adj, sizeof adj);
    while (flow = dfs(source, sink, 1 << 30)) ret += flow;
  }
  return ret;
}

tuple<int, int, int> edges[505];

int main() {
  // int a = 1, b = 100000;
  // printf("%lf\n", a / (1.0 / b));

  int n, m, x; scanf("%d %d %d", &n, &m, &x);

  int max_edge = 0;
  for (int i = 0; i < m; ++i) {
    int a, b, c; scanf("%d %d %d", &a, &b, &c);
    edges[i] = make_tuple(a, b, c);
    max_edge = max(max_edge, c);
  }

  double lo = 0.0, hi = max_edge, ans = -1;
  for (int _ = 0; _ < 1000; ++_) {
    memset(adj, -1, sizeof adj); inde = 0;

    double mid = (lo + hi) / 2;
    for (int i = 0; i < m; ++i) {
      int a, b, c;
      tie(a, b, c) = edges[i];

      c = min((long long) x, (long long) (c / mid));

      add_edge(a, b, c);
    }

    if (maxflow(1, n) >= x) {
      lo = mid;
      ans = mid;
    } else {
      hi = mid;
    }
  }

  printf("%.10lf\n", ans * x);
  return 0;
}
// 1473295491968


#include<bits/stdc++.h>

using namespace std;
typedef long long int lld;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
lld edges[100000][3];
struct edge{
  int u,v;
  lld cap,flow;
  edge() {}
  edge(int u, int v, int cap): u(u),v(v),cap(cap),flow(0) {}
};
class Dinic{
  int n;
  vector<edge>E;
  vector<vector<int> >nei;
  vector<int> dist,pt;
public:
  void init(int N){
    n=N;
    nei.resize(n);
    dist.resize(n);
    pt.resize(n);
  }
  void add(int u, int v, lld cap){
    if(u==v)return;
    E.push_back(edge(u,v,cap));
    nei[u].push_back(E.size()-1);
    E.push_back(edge(v,u,0));
    nei[v].push_back(E.size()-1);
  }
  bool BFS(int s,int t){
    queue<int> q;
    rep(i,0,n)dist[i]=-1;
    dist[s]=0;
    q.push(s);
    while(!q.empty()){
      int u=q.front();q.pop();
      if(u==t)break;
      trav(k,nei[u]){
	if(E[k].flow<E[k].cap && dist[E[k].v]==-1){
	  dist[E[k].v]=dist[E[k].u]+1;
	  q.push(E[k].v);
	}
      }
    }
    return (dist[t]!=-1);
  }
  lld DFS(int u, int t, int flow=-1){
    if(u==t || flow==0)return flow;
    rep(k,0,(int)nei[u].size()){
      edge &e=E[nei[u][k]];
      edge &oe=E[nei[u][k]^1];
      if(dist[e.v]==dist[e.u]+1){
	lld amt=e.cap-e.flow;
	if(flow!=-1 && amt>flow)amt=flow;
	if(lld pushed=DFS(e.v,t,amt)){
	  e.flow+=pushed;
	  oe.flow-=pushed;
	  return pushed;
	}
      }
    }
    return 0;
  }
  lld max_flow(int s, int t){
    lld total=0;
    while(BFS(s,t)){
      while(lld flow=DFS(s,t)){
	total+=flow;
      }
    }
    return total;
  }
};
int main(){
  int n,m,x;
  scanf("%d %d %d",&n,&m,&x);
  rep(i,0,m){
    rep(j,0,3){
      scanf("%lld",&edges[i][j]);
      if(j<2)edges[i][j]--;
    }
  }
  double lo,hi;
  lo=0;
  hi=1E7;
  while(hi-lo>1E-13){
    double mid=(hi+lo)/2;
    //printf("%.15lf %.15lf\n",lo,hi);
    Dinic D;
    D.init(n);
    rep(i,0,m){
      D.add(edges[i][0],edges[i][1],edges[i][2]/mid);
      D.add(edges[i][1],edges[i][0],edges[i][2]/mid);
    }
    int u=D.max_flow(0,n-1);
    //cout<<u<<endl;
    if(u>=x)lo=mid;
    else hi=mid;
  }
  printf("%.10lf\n",hi*x);
  return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long int lld;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
#define INF 1000000000000000000
int n,m;
lld x;
struct edge{
  int u,v;
  lld c,f;
};
lld edges[1000000][3];
vector<edge> network;
vector<int> nei[1000000];
int level[1000000];
int ptr[1000000];
void add(int u, int v, lld x){
  //cout<<u<<" "<<v<<" "<<x<<endl;
  nei[u].push_back(network.size());
  network.push_back(edge{u,v,x,0});
  nei[v].push_back(network.size());
  network.push_back(edge{v,u,0,0});
}
int s,e,V;
queue<int> q;
bool BFS(){
  rep(i,0,V){
    level[i]=-1;
  }
  level[s]=0;
  q.push(s);
  while(!q.empty()){
    int node=q.front();q.pop();
    //cout<<node<<endl;
    trav(i,nei[node]){
      if(network[i].c>network[i].f && level[network[i].v]==-1){
	q.push(network[i].v);
	level[network[i].v]=level[node]+1;
      }
    }
  }
  return (level[e]!=-1);
}
lld DFS(int node, lld flow){
  if(flow==0)return 0;
  if(node==e)return flow;

  for(;ptr[node]<nei[node].size();ptr[node]++){
    int i=nei[node][ptr[node]];
    //cout<<node<<" "<<level[network[i].v]<<" "<<network[i].c<<" "<<network[i].f<<endl;
    if(level[network[i].v]!=level[network[i].u]+1 || network[i].c==network[i].f)continue;

    lld u=DFS(network[i].v,min(flow,network[i].c-network[i].f));
    if(u>0){
      network[i].f+=u;
      network[i^1].f-=u;
      return u;
    }
  }
  return 0;
}
lld Dinic(){
  lld f=0;
  while(BFS()){//cout<<"A"<<endl;
    lld pushed=-1;
    rep(i,0,V)ptr[i]=0;

    while(pushed=DFS(s,INF)){
      f+=pushed;
    }
    //cout<<f<<endl;
  }

  return f;
}
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  scanf("%d %d %lld",&n,&m,&x);
  rep(i,0,m){
    rep(j,0,3){
      scanf("%lld",&edges[i][j]);
      if(j<2)edges[i][j]--;
    }
  }
  long double lo,hi;
  lo=0;
  hi=1000000000000;

  while(hi-lo>1E-11){
    //cout<<lo<<" "<<hi<<endl;
    long double mid=(hi-lo)/2+lo;
    rep(i,0,n)nei[i].clear();
    network.clear();
    rep(i,0,m){
      add(edges[i][0],edges[i][1],edges[i][2]/mid);
    }
    s=0;
    e=n-1;
    V=n;

    //cout<<Dinic()<<" "<<x<<" "<<lo<<" "<<hi<<endl;
    if(Dinic()>=x)lo=mid;
    else hi=mid;
    //cout<<Dinic()<<" "<<x<<" "<<lo<<" "<<hi<<endl;
    //printf("%.12lf %.12lf %.12lf\n",lo,hi,mid);
  }
  printf("%.7Lf\n",lo*x);
  return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long int lld;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
lld edges[100000][3];
struct edge{
  int u,v;
  lld cap,flow;
  edge() {}
  edge(int u, int v, lld cap): u(u),v(v),cap(cap),flow(0) {}
};
class Dinic{
  int n;
  vector<edge> E;
  vector<vector<int> >nei;
  vector<int> dist,pt;
public:
  void init(int N){
    n=N;
    nei.resize(N);
    dist.resize(N);
    pt.resize(N);
  }
  void add(int u, int v, lld cap){
    if(u!=v){
      //cout<<u<<" "<<v<<" "<<cap<<endl;
      E.push_back(edge(u,v,cap));
      nei[u].push_back(E.size()-1);
      E.push_back(edge(v,u,0));
      nei[v].push_back(E.size()-1);
    }
  }
  bool BFS(int s, int t){
    queue<int> q;
    rep(i,0,n)dist[i]=-1;
    dist[s]=0;
    q.push(s);
    while(!q.empty()){
      int u=q.front();q.pop();
      if(u==t)break;
      trav(k,nei[u]){
	if(E[k].flow<E[k].cap && dist[E[k].v]==-1){
	  dist[E[k].v]=dist[E[k].u]+1;
	  q.push(E[k].v);
	}
      }
    }
    return (dist[t]!=-1);
  }
  lld DFS(int u, int t, lld flow=-1){
    if(u==t || flow==0)return flow;
    for(int &i=pt[u];i<(int)nei[u].size();++i){
      edge &e=E[nei[u][i]];
      edge &oe=E[nei[u][i]^1];
      if(dist[e.v]==dist[e.u]+1){
	lld amt=e.cap-e.flow;
	if(flow!=-1 && amt>flow)amt=flow;
	if(lld pushed=DFS(e.v,t,amt)){
	  e.flow+=pushed;
	  oe.flow-=pushed;
	  return pushed;
	}
      }
    }
    return 0;
  }
  lld max_flow(int s, int t){
    lld total=0;
    while(BFS(s,t)){
      rep(i,0,n)pt[i]=0;
      while(lld flow=DFS(s,t)){
	total+=flow;
      }
    }
    return total;
  }
  void print(){
    rep(i,0,E.size()){
      cout<<E[i].cap<<" "<<E[i].flow<<endl;
    }
  }
};
int main(){
  int n,m,x;
  scanf("%d %d %d",&n,&m,&x);
  rep(i,0,m){
    rep(j,0,3){
      scanf("%lld",&edges[i][j]);
      if(j<2)edges[i][j]--;
    }
  }
  double lo,hi;
  lo=0;
  hi=1E7;
  while(hi-lo>1E-13){
    double mid=(hi+lo)/2;
    //printf("%.15lf %.15lf\n",lo,hi);
    Dinic D;
    D.init(n);
    rep(i,0,m){
      D.add(edges[i][0],edges[i][1],(double)edges[i][2]/mid);
      D.add(edges[i][1],edges[i][0],(double)edges[i][2]/mid);
    }
    int u=D.max_flow(0,n-1);
    //cout<<u<<endl;
    if(u>=x)lo=mid;
    else hi=mid;
  }
  printf("%.10lf\n",hi*x);
  return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long int lld;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
lld edges[100000][3];
struct edge{
  int u,v;
  lld cap,flow;
  edge() {}
  edge(int u, int v, int cap): u(u),v(v),cap(cap),flow(0) {}
};
class Dinic{
  int n;
  vector<edge>E;
  vector<vector<int> >nei;
  vector<int> dist,pt;
public:
  void init(int N){
    n=N;
    nei.resize(n);
    dist.resize(n);
    pt.resize(n);
  }
  void add(int u, int v, lld cap){
    if(u==v)return;
    E.push_back(edge(u,v,cap));
    nei[u].push_back(E.size()-1);
    E.push_back(edge(v,u,0));
    nei[v].push_back(E.size()-1);
  }
  bool BFS(int s,int t){
    queue<int> q;
    rep(i,0,n)dist[i]=-1;
    dist[s]=0;
    q.push(s);
    while(!q.empty()){
      int u=q.front();q.pop();
      if(u==t)break;
      trav(k,nei[u]){
	if(E[k].flow<E[k].cap && dist[E[k].v]==-1){
	  dist[E[k].v]=dist[E[k].u]+1;
	  q.push(E[k].v);
	}
      }
    }
    return (dist[t]!=-1);
  }
  lld DFS(int u, int t, int flow=-1){
    if(u==t || flow==0)return flow;
    rep(k,0,(int)nei[u].size()){
      edge &e=E[nei[u][k]];
      edge &oe=E[nei[u][k]^1];
      if(dist[e.v]==dist[e.u]+1){
	lld amt=e.cap-e.flow;
	if(flow!=-1 && amt>flow)amt=flow;
	if(lld pushed=DFS(e.v,t,amt)){
	  e.flow+=pushed;
	  oe.flow-=pushed;
	  return pushed;
	}
      }
    }
    return 0;
  }
  lld max_flow(int s, int t){
    lld total=0;
    while(BFS(s,t)){
      while(lld flow=DFS(s,t)){
	total+=flow;
      }
    }
    return total;
  }
};
int main(){
  int n,m,x;
  scanf("%d %d %d",&n,&m,&x);
  rep(i,0,m){
    rep(j,0,3){
      scanf("%lld",&edges[i][j]);
      if(j<2)edges[i][j]--;
    }
  }
  double lo,hi;
  lo=0;
  hi=1E17;
  while(hi-lo>1E-13){
    double mid=(hi+lo)/2;
    //printf("%.15lf %.15lf\n",lo,hi);
    Dinic D;
    D.init(n);
    rep(i,0,m){
      D.add(edges[i][0],edges[i][1],edges[i][2]/mid);
      D.add(edges[i][1],edges[i][0],edges[i][2]/mid);
    }
    int u=D.max_flow(0,n-1);
    //cout<<u<<endl;
    if(u>=x)lo=mid;
    else hi=mid;
  }
  printf("%.10lf\n",hi*x);
  return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long int lld;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
#define INF 1000000000000000000
int n,m;
lld x;
struct edge{
  int u,v;
  lld c,f;
};
lld edges[1000000][3];
vector<edge> network;
vector<int> nei[1000000];
int level[1000000];
int ptr[1000000];
void add(int u, int v, lld x){
  //cout<<u<<" "<<v<<" "<<x<<endl;
  nei[u].push_back(network.size());
  network.push_back(edge{u,v,x,0});
  nei[v].push_back(network.size());
  network.push_back(edge{v,u,0,0});
}
int s,e,V;
queue<int> q;
bool BFS(){
  rep(i,0,V){
    level[i]=-1;
  }
  level[s]=0;
  q.push(s);
  while(!q.empty()){
    int node=q.front();q.pop();
    //cout<<node<<endl;
    trav(i,nei[node]){
      if(network[i].c>network[i].f && level[network[i].v]==-1){
	q.push(network[i].v);
	level[network[i].v]=level[node]+1;
      }
    }
  }
  return (level[e]!=-1);
}
lld DFS(int node, lld flow){
  if(flow==0)return 0;
  if(node==e)return flow;

  for(;ptr[node]<nei[node].size();ptr[node]++){
    int i=nei[node][ptr[node]];
    //cout<<node<<" "<<level[network[i].v]<<" "<<network[i].c<<" "<<network[i].f<<endl;
    if(level[network[i].v]!=level[network[i].u]+1 || network[i].c==network[i].f)continue;

    lld u=DFS(network[i].v,min(flow,network[i].c-network[i].f));
    if(u>0){
      network[i].f+=u;
      network[i^1].f-=u;
      return u;
    }
  }
  return 0;
}
lld Dinic(){
  lld f=0;
  while(BFS()){//cout<<"A"<<endl;
    lld pushed=-1;
    rep(i,0,V)ptr[i]=0;

    while(pushed=DFS(s,INF)){
      f+=pushed;
    }
    //cout<<f<<endl;
  }

  return f;
}
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  scanf("%d %d %lld",&n,&m,&x);
  rep(i,0,m){
    rep(j,0,3){
      scanf("%lld",&edges[i][j]);
      if(j<2)edges[i][j]--;
    }
  }
  double lo,hi;
  lo=0;
  hi=1000000000000;
  while(hi-lo>1E-8){
    double mid=(lo+hi)/2;
    rep(i,0,n)nei[i].clear();
    network.clear();
    rep(i,0,m){
      add(edges[i][0],edges[i][1],edges[i][2]/mid);
    }
    s=0;
    e=n-1;
    V=n;

    //cout<<Dinic()<<" "<<x<<" "<<lo<<" "<<hi<<endl;
    if(Dinic()>=x)lo=mid;
    else hi=mid;
    //cout<<Dinic()<<" "<<x<<" "<<lo<<" "<<hi<<endl;
    //cout<<lo<<" "<<hi<<endl;
  }
  printf("%.7lf\n",lo*x);
  return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long int lld;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
#define INF 1000000000000000000
int n,m;
lld x;
struct edge{
  int u,v;
  lld c,f;
};
lld edges[1000000][3];
vector<edge> network;
vector<int> nei[1000000];
int level[1000000];
int ptr[1000000];
void add(int u, int v, lld x){
  //cout<<u<<" "<<v<<" "<<x<<endl;
  nei[u].push_back(network.size());
  network.push_back(edge{u,v,x,0});
  nei[v].push_back(network.size());
  network.push_back(edge{v,u,0,0});
}
int s,e,V;
queue<int> q;
bool BFS(){
  rep(i,0,V){
    level[i]=-1;
  }
  level[s]=0;
  q.push(s);
  while(!q.empty()){
    int node=q.front();q.pop();
    //cout<<node<<endl;
    trav(i,nei[node]){
      if(network[i].c>network[i].f && level[network[i].v]==-1){
	q.push(network[i].v);
	level[network[i].v]=level[node]+1;
      }
    }
  }
  return (level[e]!=-1);
}
lld DFS(int node, lld flow){
  if(flow==0)return 0;
  if(node==e)return flow;

  for(;ptr[node]<nei[node].size();ptr[node]++){
    int i=nei[node][ptr[node]];
    //cout<<node<<" "<<level[network[i].v]<<" "<<network[i].c<<" "<<network[i].f<<endl;
    if(level[network[i].v]!=level[network[i].u]+1 || network[i].c==network[i].f)continue;

    lld u=DFS(network[i].v,min(flow,network[i].c-network[i].f));
    if(u>0){
      network[i].f+=u;
      network[i^1].f-=u;
      return u;
    }
  }
  return 0;
}
lld Dinic(){
  lld f=0;
  while(BFS()){//cout<<"A"<<endl;
    lld pushed=-1;
    rep(i,0,V)ptr[i]=0;

    while(pushed=DFS(s,INF)){
      f+=pushed;
    }
    //cout<<f<<endl;
  }

  return f;
}
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  scanf("%d %d %lld",&n,&m,&x);
  rep(i,0,m){
    rep(j,0,3){
      scanf("%lld",&edges[i][j]);
      if(j<2)edges[i][j]--;
    }
  }
  long double lo,hi;
  lo=0;
  hi=1000000000000;

  while(hi-lo>1E-11){
    //cout<<lo<<" "<<hi<<endl;
    long double mid=(hi-lo)/2+lo;
    rep(i,0,n)nei[i].clear();
    network.clear();
    rep(i,0,m){
      add(edges[i][0],edges[i][1],edges[i][2]/mid);
    }
    s=0;
    e=n-1;
    V=n;

    //cout<<Dinic()<<" "<<x<<" "<<lo<<" "<<hi<<endl;
    if(Dinic()>=x)lo=mid;
    else hi=mid;
    //cout<<Dinic()<<" "<<x<<" "<<lo<<" "<<hi<<endl;
    //printf("%.12lf %.12lf %.12lf\n",lo,hi,mid);
    cout<<lo<<" "<<hi<endl;
  }
  printf("%.7Lf\n",lo*x);
  return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long int lld;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
lld edges[100000][3];
struct edge{
  int u,v;
  lld cap,flow;
  edge() {}
  edge(int u, int v, int cap): u(u),v(v),cap(cap),flow(0) {}
};
class Dinic{
  int n;
  vector<edge>E;
  vector<vector<int> >nei;
  vector<int> dist,pt;
public:
  void init(int N){
    n=N;
    nei.resize(n);
    dist.resize(n);
    pt.resize(n);
  }
  void add(int u, int v, lld cap){
    if(u==v)return;
    E.push_back(edge(u,v,cap));
    nei[u].push_back(E.size()-1);
    E.push_back(edge(v,u,0));
    nei[v].push_back(E.size()-1);
  }
  bool BFS(int s,int t){
    queue<int> q;
    rep(i,0,n)dist[i]=-1;
    dist[s]=0;
    q.push(s);
    while(!q.empty()){
      int u=q.front();q.pop();
      if(u==t)break;
      trav(k,nei[u]){
	if(E[k].flow<E[k].cap && dist[E[k].v]==-1){
	  dist[E[k].v]=dist[E[k].u]+1;
	  q.push(E[k].v);
	}
      }
    }
    return (dist[t]!=-1);
  }
  lld DFS(int u, int t, int flow=-1){
    if(u==t || flow==0)return flow;
    rep(k,0,(int)nei[u].size()){
      edge &e=E[nei[u][k]];
      edge &oe=E[nei[u][k]^1];
      if(dist[e.v]==dist[e.u]+1){
	lld amt=e.cap-e.flow;
	if(flow!=-1 && amt>flow)amt=flow;
	if(lld pushed=DFS(e.v,t,amt)){
	  e.flow+=pushed;
	  oe.flow-=pushed;
	  return pushed;
	}
      }
    }
    return 0;
  }
  lld max_flow(int s, int t){
    lld total=0;
    while(BFS(s,t)){
      while(lld flow=DFS(s,t)){
	total+=flow;
      }
    }
    return total;
  }
};
int main(){
  int n,m,x;
  scanf("%d %d %d",&n,&m,&x);
  rep(i,0,m){
    rep(j,0,3){
      scanf("%lld",&edges[i][j]);
      if(j<2)edges[i][j]--;
    }
  }
  double lo,hi;
  lo=0;
  hi=1E17;
  while(hi-lo>1E-15){
    double mid=(hi+lo)/2;
    Dinic D;
    D.init(n);
    rep(i,0,m){
      D.add(edges[i][0],edges[i][1],edges[i][2]/mid);
      D.add(edges[i][1],edges[i][0],edges[i][2]/mid);
    }
    int u=D.max_flow(0,n-1);
    //cout<<u<<endl;
    if(u>=x)lo=mid;
    else hi=mid;
  }
  printf("%.8lf\n",hi*x);
  return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long int lld;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
lld edges[100000][3];
struct edge{
  int u,v;
  lld cap,flow;
  edge() {}
  edge(int u, int v, lld cap): u(u),v(v),cap(cap),flow(0) {}
};
class Dinic{
  int n;
  vector<edge> E;
  vector<vector<int> >nei;
  vector<int> dist,pt;
public:
  void init(int N){
    n=N;
    nei.resize(N);
    dist.resize(N);
    pt.resize(N);
  }
  void add(int u, int v, lld cap){
    if(u!=v){
      //cout<<u<<" "<<v<<" "<<cap<<endl;
      E.push_back(edge(u,v,cap));
      nei[u].push_back(E.size()-1);
      E.push_back(edge(v,u,0));
      nei[v].push_back(E.size()-1);
    }
  }
  bool BFS(int s, int t){
    queue<int> q;
    rep(i,0,n)dist[i]=-1;
    dist[s]=0;
    q.push(s);
    while(!q.empty()){
      int u=q.front();q.pop();
      if(u==t)break;
      trav(k,nei[u]){
	if(E[k].flow<E[k].cap && dist[E[k].v]==-1){
	  dist[E[k].v]=dist[E[k].u]+1;
	  q.push(E[k].v);
	}
      }
    }
    return (dist[t]!=-1);
  }
  lld DFS(int u, int t, lld flow=-1){
    if(u==t || flow==0)return flow;
    for(int &i=pt[u];i<(int)nei[u].size();++i){
      edge &e=E[nei[u][i]];
      edge &oe=E[nei[u][i]^1];
      if(dist[e.v]==dist[e.u]+1){
	lld amt=e.cap-e.flow;
	if(flow!=-1 && amt>flow)amt=flow;
	if(lld pushed=DFS(e.v,t,amt)){
	  e.flow+=pushed;
	  oe.flow-=pushed;
	  return pushed;
	}
      }
    }
    return 0;
  }
  lld max_flow(int s, int t){
    lld total=0;
    while(BFS(s,t)){
      rep(i,0,n)pt[i]=0;
      while(lld flow=DFS(s,t)){
	total+=flow;
      }
    }
    return total;
  }
  void print(){
    rep(i,0,E.size()){
      cout<<E[i].cap<<" "<<E[i].flow<<endl;
    }
  }
};
int main(){
  int n,m,x;
  scanf("%d %d %d",&n,&m,&x);
  rep(i,0,m){
    rep(j,0,3){
      scanf("%lld",&edges[i][j]);
      if(j<2)edges[i][j]--;
    }
  }
  double lo,hi;
  lo=0;
  hi=1E7;
  while(hi-lo>1E-13){
    double mid=(hi+lo)/2;
    //printf("%.15lf %.15lf\n",lo,hi);
    Dinic D;
    D.init(n);
    rep(i,0,m){
      D.add(edges[i][0],edges[i][1],edges[i][2]/mid);
      D.add(edges[i][1],edges[i][0],edges[i][2]/mid);
    }
    int u=D.max_flow(0,n-1);
    //cout<<u<<endl;
    if(u>=x)lo=mid;
    else hi=mid;
  }
  printf("%.10lf\n",hi*x);
  return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long int lld;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
#define INF 1000000000000000000
int n,m;
lld x;
struct edge{
  int u,v;
  lld c,f;
};
lld edges[1000000][3];
vector<edge> network;
vector<int> nei[1000000];
int level[1000000];
int ptr[1000000];
void add(int u, int v, lld x){
  //cout<<u<<" "<<v<<" "<<x<<endl;
  nei[u].push_back(network.size());
  network.push_back(edge{u,v,x,0});
  nei[v].push_back(network.size());
  network.push_back(edge{v,u,0,0});
}
int s,e,V;
queue<int> q;
bool BFS(){
  rep(i,0,V){
    level[i]=-1;
  }
  level[s]=0;
  q.push(s);
  while(!q.empty()){
    int node=q.front();q.pop();
    //cout<<node<<endl;
    trav(i,nei[node]){
      if(network[i].c>network[i].f && level[network[i].v]==-1){
	q.push(network[i].v);
	level[network[i].v]=level[node]+1;
      }
    }
  }
  return (level[e]!=-1);
}
lld DFS(int node, lld flow){
  if(flow==0)return 0;
  if(node==e)return flow;

  for(;ptr[node]<nei[node].size();ptr[node]++){
    int i=nei[node][ptr[node]];
    //cout<<node<<" "<<level[network[i].v]<<" "<<network[i].c<<" "<<network[i].f<<endl;
    if(level[network[i].v]!=level[network[i].u]+1 || network[i].c==network[i].f)continue;

    lld u=DFS(network[i].v,min(flow,network[i].c-network[i].f));
    if(u>0){
      network[i].f+=u;
      network[i^1].f-=u;
      return u;
    }
  }
  return 0;
}
lld Dinic(){
  lld f=0;
  while(BFS()){//cout<<"A"<<endl;
    lld pushed=-1;
    rep(i,0,V)ptr[i]=0;

    while(pushed=DFS(s,INF)){
      f+=pushed;
    }
    //cout<<f<<endl;
  }

  return f;
}
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  scanf("%d %d %lld",&n,&m,&x);
  rep(i,0,m){
    rep(j,0,3){
      scanf("%lld",&edges[i][j]);
      if(j<2)edges[i][j]--;
    }
  }
  double lo,hi;
  lo=0;
  hi=1000000000000;
  while(hi-lo>3E-10){
    double mid=(lo+hi)/2;
    rep(i,0,n)nei[i].clear();
    network.clear();
    rep(i,0,m){
      add(edges[i][0],edges[i][1],edges[i][2]/mid);
    }
    s=0;
    e=n-1;
    V=n;

    //cout<<Dinic()<<" "<<x<<" "<<lo<<" "<<hi<<endl;
    if(Dinic()>=x)lo=mid;
    else hi=mid;
    //cout<<Dinic()<<" "<<x<<" "<<lo<<" "<<hi<<endl;
    //cout<<lo<<" "<<hi<<endl;
  }
  printf("%.7lf\n",lo*x);
  return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long int lld;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
lld edges[100000][3];
struct edge{
  int u,v;
  lld cap,flow;
  edge() {}
  edge(int u, int v, lld cap): u(u),v(v),cap(cap),flow(0) {}
};
class dinic{
  int n;
  vector<edge> E;
  vector<vector<int> >nei;
  vector<int> dist,pt;
public:
  void init(int N){
    n=N;
    nei.resize(N);
    dist.resize(N);
    pt.resize(N);
  }
  void add(int u, int v, lld cap){
    if(u!=v){
      //cout<<u<<" "<<v<<" "<<cap<<endl;
      E.push_back(edge(u,v,cap));
      nei[u].push_back(E.size()-1);
      E.push_back(edge(v,u,0));
      nei[v].push_back(E.size()-1);
    }
  }
  bool BFS(int s, int t){
    queue<int> q;
    rep(i,0,n)dist[i]=-1;
    dist[s]=0;
    q.push(s);
    while(!q.empty()){
      int u=q.front();q.pop();
      if(u==t)break;
      trav(k,nei[u]){
	if(E[k].flow<E[k].cap && dist[E[k].v]==-1){
	  dist[E[k].v]=dist[E[k].u]+1;
	  q.push(E[k].v);
	}
      }
    }
    return (dist[t]!=-1);
  }
  lld DFS(int u, int t, lld flow=-1){
    if(u==t || flow==0)return flow;
    for(int &i=pt[u];i<(int)nei[u].size();++i){
      edge &e=E[nei[u][i]];
      edge &oe=E[nei[u][i]^1];
      if(dist[e.v]==dist[e.u]+1){
	lld amt=e.cap-e.flow;
	if(flow!=-1 && amt>flow)amt=flow;
	if(lld pushed=DFS(e.v,t,amt)){
	  e.flow+=pushed;
	  oe.flow-=pushed;
	  return pushed;
	}
      }
    }
    return 0;
  }
  lld max_flow(int s, int t){
    lld total=0;
    while(BFS(s,t)){
      rep(i,0,n)pt[i]=0;
      while(lld flow=DFS(s,t)){
	total+=flow;
      }
    }
    return total;
  }
  void print(){
    rep(i,0,E.size()){
      cout<<E[i].cap<<" "<<E[i].flow<<endl;
    }
  }
};
int main(){
  int n,m,x;
  scanf("%d %d %d",&n,&m,&x);
  rep(i,0,m){
    rep(j,0,3){
      scanf("%lld",&edges[i][j]);
      if(j<2)edges[i][j]--;
    }
  }
  double lo,hi;
  lo=0;
  hi=1E7;
  while(hi-lo>1E-13){
    double mid=(hi+lo)/2;
    //printf("%.15lf %.15lf\n",lo,hi);
    Dinic D;
    D.init(n);
    rep(i,0,m){
      D.add(edges[i][0],edges[i][1],edges[i][2]/mid);
      D.add(edges[i][1],edges[i][0],edges[i][2]/mid);
    }
    int u=D.max_flow(0,n-1);
    //cout<<u<<endl;
    if(u>=x)lo=mid;
    else hi=mid;
  }
  printf("%.10lf\n",hi*x);
  return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long int lld;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
#define INF 1000000000000000000
int n,m;
lld x;
struct edge{
  int u,v;
  lld c,f;
};
lld edges[1000000][3];
vector<edge> network;
vector<int> nei[1000000];
int level[1000000];
int ptr[1000000];
void add(int u, int v, lld x){
  //cout<<u<<" "<<v<<" "<<x<<endl;
  nei[u].push_back(network.size());
  network.push_back(edge{u,v,x,0});
  nei[v].push_back(network.size());
  network.push_back(edge{v,u,0,0});
}
int s,e,V;
queue<int> q;
bool BFS(){
  rep(i,0,V){
    level[i]=-1;
  }
  level[s]=0;
  q.push(s);
  while(!q.empty()){
    int node=q.front();q.pop();
    //cout<<node<<endl;
    trav(i,nei[node]){
      if(network[i].c>network[i].f && level[network[i].v]==-1){
	q.push(network[i].v);
	level[network[i].v]=level[node]+1;
      }
    }
  }
  return (level[e]!=-1);
}
lld DFS(int node, lld flow){
  if(flow==0)return 0;
  if(node==e)return flow;

  for(;ptr[node]<nei[node].size();ptr[node]++){
    int i=nei[node][ptr[node]];
    //cout<<node<<" "<<level[network[i].v]<<" "<<network[i].c<<" "<<network[i].f<<endl;
    if(level[network[i].v]!=level[network[i].u]+1 || network[i].c==network[i].f)continue;

    lld u=DFS(network[i].v,min(flow,network[i].c-network[i].f));
    if(u>0){
      network[i].f+=u;
      network[i^1].f-=u;
      return u;
    }
  }
  return 0;
}
lld Dinic(){
  lld f=0;
  while(BFS()){//cout<<"A"<<endl;
    lld pushed=-1;
    rep(i,0,V)ptr[i]=0;

    while(pushed=DFS(s,INF)){
      f+=pushed;
    }
    //cout<<f<<endl;
  }

  return f;
}
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  scanf("%d %d %lld",&n,&m,&x);
  rep(i,0,m){
    rep(j,0,3){
      scanf("%lld",&edges[i][j]);
      if(j<2)edges[i][j]--;
    }
  }
  double lo,hi;
  lo=0;
  hi=1000000000000;

  rep(test,0,100){
    //cout<<lo<<" "<<hi<<endl;
    double mid=(hi-lo)/2+lo;
    rep(i,0,n)nei[i].clear();
    network.clear();
    rep(i,0,m){
      add(edges[i][0],edges[i][1],edges[i][2]/mid);
    }
    s=0;
    e=n-1;
    V=n;

    //cout<<Dinic()<<" "<<x<<" "<<lo<<" "<<hi<<endl;
    if(Dinic()>=x)lo=mid;
    else hi=mid;
    //cout<<Dinic()<<" "<<x<<" "<<lo<<" "<<hi<<endl;
    //printf("%.12lf %.12lf %.12lf\n",lo,hi,mid);
  }
  printf("%.7lf\n",lo*x);
  return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long int lld;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
#define INF 1000000000000000000
int n,m;
lld x;
struct edge{
  int u,v;
  lld c,f;
};
lld edges[1000000][3];
vector<edge> network;
vector<int> nei[1000000];
int level[1000000];
int ptr[1000000];
void add(int u, int v, lld x){
  //cout<<u<<" "<<v<<" "<<x<<endl;
  nei[u].push_back(network.size());
  network.push_back(edge{u,v,x,0});
  nei[v].push_back(network.size());
  network.push_back(edge{v,u,0,0});
}
int s,e,V;
queue<int> q;
bool BFS(){
  rep(i,0,V){
    level[i]=-1;
  }
  level[s]=0;
  q.push(s);
  while(!q.empty()){
    int node=q.front();q.pop();
    //cout<<node<<endl;
    trav(i,nei[node]){
      if(network[i].c>network[i].f && level[network[i].v]==-1){
	q.push(network[i].v);
	level[network[i].v]=level[node]+1;
      }
    }
  }
  return (level[e]!=-1);
}
lld DFS(int node, lld flow){
  if(flow==0)return 0;
  if(node==e)return flow;

  for(;ptr[node]<nei[node].size();ptr[node]++){
    int i=nei[node][ptr[node]];
    //cout<<node<<" "<<level[network[i].v]<<" "<<network[i].c<<" "<<network[i].f<<endl;
    if(level[network[i].v]!=level[network[i].u]+1 || network[i].c==network[i].f)continue;

    lld u=DFS(network[i].v,min(flow,network[i].c-network[i].f));
    if(u>0){
      network[i].f+=u;
      network[i^1].f-=u;
      return u;
    }
  }
  return 0;
}
lld Dinic(){
  lld f=0;
  while(BFS()){//cout<<"A"<<endl;
    lld pushed=-1;
    rep(i,0,V)ptr[i]=0;

    while(pushed=DFS(s,INF)){
      f+=pushed;
    }
    //cout<<f<<endl;
  }

  return f;
}
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  scanf("%d %d %lld",&n,&m,&x);
  rep(i,0,m){
    rep(j,0,3){
      scanf("%lld",&edges[i][j]);
      if(j<2)edges[i][j]--;
    }
  }
  double lo,hi;
  lo=0;
  hi=1000000000000;
  while(hi-lo>1E-9){
    double mid=(lo+hi)/2;
    rep(i,0,n)nei[i].clear();
    network.clear();
    rep(i,0,m){
      add(edges[i][0],edges[i][1],edges[i][2]/mid);
    }
    s=0;
    e=n-1;
    V=n;

    //cout<<Dinic()<<" "<<x<<" "<<lo<<" "<<hi<<endl;
    if(Dinic()>=x)lo=mid;
    else hi=mid;
    //cout<<Dinic()<<" "<<x<<" "<<lo<<" "<<hi<<endl;
    //cout<<lo<<" "<<hi<<endl;
  }
  printf("%.7lf\n",lo*x);
  return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long int lld;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
#define INF 1000000000000000000
int n,m;
lld x;
struct edge{
  int u,v;
  lld c,f;
};
lld edges[1000000][3];
vector<edge> network;
vector<int> nei[1000000];
int level[1000000];
int ptr[1000000];
void add(int u, int v, lld x){
  //cout<<u<<" "<<v<<" "<<x<<endl;
  nei[u].push_back(network.size());
  network.push_back(edge{u,v,x,0});
  nei[v].push_back(network.size());
  network.push_back(edge{v,u,0,0});
}
int s,e,V;
queue<int> q;
bool BFS(){
  rep(i,0,V){
    level[i]=-1;
  }
  level[s]=0;
  q.push(s);
  while(!q.empty()){
    int node=q.front();q.pop();
    //cout<<node<<endl;
    trav(i,nei[node]){
      if(network[i].c>network[i].f && level[network[i].v]==-1){
	q.push(network[i].v);
	level[network[i].v]=level[node]+1;
      }
    }
  }
  return (level[e]!=-1);
}
lld DFS(int node, lld flow){
  if(flow==0)return 0;
  if(node==e)return flow;

  for(;ptr[node]<nei[node].size();ptr[node]++){
    int i=nei[node][ptr[node]];
    //cout<<node<<" "<<level[network[i].v]<<" "<<network[i].c<<" "<<network[i].f<<endl;
    if(level[network[i].v]!=level[network[i].u]+1 || network[i].c==network[i].f)continue;

    lld u=DFS(network[i].v,min(flow,network[i].c-network[i].f));
    if(u>0){
      network[i].f+=u;
      network[i^1].f-=u;
      return u;
    }
  }
  return 0;
}
lld Dinic(){
  lld f=0;
  while(BFS()){//cout<<"A"<<endl;
    lld pushed=-1;
    rep(i,0,V)ptr[i]=0;

    while(pushed=DFS(s,INF)){
      f+=pushed;
    }
    //cout<<f<<endl;
  }

  return f;
}
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  scanf("%d %d %lld",&n,&m,&x);
  rep(i,0,m){
    rep(j,0,3){
      scanf("%lld",&edges[i][j]);
      if(j<2)edges[i][j]--;
    }
  }
  double lo,hi;
  lo=0;
  hi=1000000000000;
  while(hi-lo>1E-12){
    double mid=(lo+hi)/2;
    rep(i,0,n)nei[i].clear();
    network.clear();
    rep(i,0,m){
      add(edges[i][0],edges[i][1],edges[i][2]/mid);
    }
    s=0;
    e=n-1;
    V=n;

    //cout<<Dinic()<<" "<<x<<" "<<lo<<" "<<hi<<endl;
    if(Dinic()>=x)lo=mid;
    else hi=mid;
    //cout<<Dinic()<<" "<<x<<" "<<lo<<" "<<hi<<endl;
  }
  printf("%.7lf\n",lo*x);
  return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long int lld;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
lld edges[100000][3];
struct edge{
  int u,v;
  lld cap,flow;
  edge() {}
  edge(int u, int v, int cap): u(u),v(v),cap(cap),flow(0) {}
};
class Dinic{
  int n;
  vector<edge>E;
  vector<vector<int> >nei;
  vector<int> dist,pt;
public:
  void init(int N){
    n=N;
    nei.resize(n);
    dist.resize(n);
    pt.resize(n);
  }
  void add(int u, int v, lld cap){
    if(u==v)return;
    E.push_back(edge(u,v,cap));
    nei[u].push_back(E.size()-1);
    E.push_back(edge(v,u,0));
    nei[v].push_back(E.size()-1);
  }
  bool BFS(int s,int t){
    queue<int> q;
    rep(i,0,n)dist[i]=-1;
    dist[s]=0;
    q.push(s);
    while(!q.empty()){
      int u=q.front();q.pop();
      if(u==t)break;
      trav(k,nei[u]){
	if(E[k].flow<E[k].cap && dist[E[k].v]==-1){
	  dist[E[k].v]=dist[E[k].u]+1;
	  q.push(E[k].v);
	}
      }
    }
    return (dist[t]!=-1);
  }
  lld DFS(int u, int t, int flow=-1){
    if(u==t || flow==0)return flow;
    rep(k,0,(int)nei[u].size()){
      edge &e=E[nei[u][k]];
      edge &oe=E[nei[u][k]^1];
      if(dist[e.v]==dist[e.u]+1){
	lld amt=e.cap-e.flow;
	if(flow!=-1 && amt>flow)amt=flow;
	if(lld pushed=DFS(e.v,t,amt)){
	  e.flow+=pushed;
	  oe.flow-=pushed;
	  return pushed;
	}
      }
    }
    return 0;
  }
  lld max_flow(int s, int t){
    lld total=0;
    while(BFS(s,t)){
      while(lld flow=DFS(s,t)){
	total+=flow;
      }
    }
    return total;
  }
};
int main(){
  int n,m,x;
  scanf("%d %d %d",&n,&m,&x);
  rep(i,0,m){
    rep(j,0,3){
      scanf("%lld",&edges[i][j]);
      if(j<2)edges[i][j]--;
    }
  }
  double lo,hi;
  lo=0;
  hi=1E17;
  while(hi-lo>1E-10){
    double mid=(hi+lo)/2;
    Dinic D;
    D.init(n);
    rep(i,0,m){
      D.add(edges[i][0],edges[i][1],edges[i][2]/mid);
      D.add(edges[i][1],edges[i][0],edges[i][2]/mid);
    }
    int u=D.max_flow(0,n-1);
    //cout<<u<<endl;
    if(u>=x)lo=mid;
    else hi=mid;
  }
  printf("%.8lf\n",hi*x);
  return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long int lld;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define trav(a,v) for(auto a:v)
#define INF 1000000000000000000
int n,m;
lld x;
struct edge{
  int u,v;
  lld c,f;
};
lld edges[1000000][3];
vector<edge> network;
vector<int> nei[1000000];
int level[1000000];
int ptr[1000000];
void add(int u, int v, lld x){
  //cout<<u<<" "<<v<<" "<<x<<endl;
  nei[u].push_back(network.size());
  network.push_back(edge{u,v,x,0});
  nei[v].push_back(network.size());
  network.push_back(edge{v,u,0,0});
}
int s,e,V;
queue<int> q;
bool BFS(){
  rep(i,0,V){
    level[i]=-1;
  }
  level[s]=0;
  q.push(s);
  while(!q.empty()){
    int node=q.front();q.pop();
    //cout<<node<<endl;
    trav(i,nei[node]){
      if(network[i].c>network[i].f && level[network[i].v]==-1){
	q.push(network[i].v);
	level[network[i].v]=level[node]+1;
      }
    }
  }
  return (level[e]!=-1);
}
lld DFS(int node, lld flow){
  if(flow==0)return 0;
  if(node==e)return flow;

  for(;ptr[node]<nei[node].size();ptr[node]++){
    int i=nei[node][ptr[node]];
    //cout<<node<<" "<<level[network[i].v]<<" "<<network[i].c<<" "<<network[i].f<<endl;
    if(level[network[i].v]!=level[network[i].u]+1 || network[i].c==network[i].f)continue;

    lld u=DFS(network[i].v,min(flow,network[i].c-network[i].f));
    if(u>0){
      network[i].f+=u;
      network[i^1].f-=u;
      return u;
    }
  }
  return 0;
}
lld Dinic(){
  lld f=0;
  while(BFS()){//cout<<"A"<<endl;
    lld pushed=-1;
    rep(i,0,V)ptr[i]=0;

    while(pushed=DFS(s,INF)){
      f+=pushed;
    }
    //cout<<f<<endl;
  }

  return f;
}
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  scanf("%d %d %lld",&n,&m,&x);
  rep(i,0,m){
    rep(j,0,3){
      scanf("%lld",&edges[i][j]);
      if(j<2)edges[i][j]--;
    }
  }
  double lo,hi;
  lo=0;
  hi=1000000000000;
  while(hi-lo>1E-10){
    double mid=(lo+hi)/2;
    rep(i,0,n)nei[i].clear();
    network.clear();
    rep(i,0,m){
      add(edges[i][0],edges[i][1],edges[i][2]/mid);
    }
    s=0;
    e=n-1;
    V=n;

    //cout<<Dinic()<<" "<<x<<" "<<lo<<" "<<hi<<endl;
    if(Dinic()>=x)lo=mid;
    else hi=mid;
    //cout<<Dinic()<<" "<<x<<" "<<lo<<" "<<hi<<endl;
    //cout<<lo<<" "<<hi<<endl;
  }
  printf("%.7lf\n",lo*x);
  return 0;
}


// Smile please :)

#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <cctype>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <string>
#include <iomanip>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <map>
#include <list>
#include <bitset>
#include <climits>
#include <unordered_map>
#include <unordered_set>
using namespace std;

//#undef KVARK_DEBUG

#ifdef KVARK_DEBUG
	#include "../h/debug.h"
#else
#define dbg(...) (void(1));
#define dbg2(...) (void(1));
#define dbg3(...) (void(1));
#define dbg4(...) (void(1));
#define dbg5(...) (void(1));
#define dbgp(...) (void(1));
#define dbg_arr(...) (void(1));
#define dbg_vec(...) (void(1));
#endif

typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef pair<double, int> pdi;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > vvi;
typedef vector<vector<pii> > vvpii;
typedef vector<vector<long long> > vvl;
typedef vector<long long> vl;
typedef long long int llint;

#define ALL(v) (v.begin()), (v.end())
#define SZ(v) ((int)((v).size()))
#define endl "\n"

void task();

int main(){
#ifdef KVARK
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#else
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	srand(time(0));
#endif
//	ios_base::sync_with_stdio(0);

	task();

#ifdef KVARK_DEBUG
	my_debug::printProcessInfo();
#endif
	return 0;
}
const int INF = 0x3f3f3f3f;
const int N = 1e5+10;
const int M = 3e5+10;

struct Rib {
	int from;
	int to;
	double f;
	int c;
};

int n, m, x;
vi g[51];
int pt[51];
Rib e[510*2];
int esz = 0;
double W;
int S = 0;
int T = 0;
int d[51];

void pushRib(int a, int b, int c) {
	g[a].push_back(esz);
	e[esz++] = Rib{a, b, 0, c};
	g[b].push_back(esz);
	e[esz++] = Rib{b, a, 0, 0};
}

bool bfs() {
	memset(d, 0x3f, sizeof(d));
	d[S] = 0;
	queue<int> q;
	q.push(S);
	while (!q.empty()) {
		int v = q.front();
		q.pop();
		for (int i: g[v]) {
			Rib& r = e[i];
			if (d[r.to] == INF && r.c - r.f >= W) {
				d[r.to] = d[v] + 1;
				q.push(r.to);
			}
		}
	}
	return d[T] != INF;
}

double dfs(int v, double f) {
	if (v == T)
		return f;
	if (f < W)
		return 0;
	double r = 0;
	for (;pt[v] < g[v].size(); ++pt[v]) {
		Rib& rib = e[g[v][pt[v]]];
		if (d[v] + 1 == d[rib.to]) {
			double yet = int((rib.c - rib.f) / W) * W;
			double add = dfs(rib.to, min(f, yet));
			r += add;
			f -= add;
			rib.f += add;
			e[g[v][pt[v]]^1].f -= add;
			if (f < W)
				return r;
		}
	}
	return r;
}

bool solve() {
	double flow = 0;
	for (int i = 0; i < esz; ++i)
		e[i].f = 0;
	while (bfs()) {
		memset(pt, 0, sizeof(pt));
		flow += dfs(S, INF);
	}
	return (int)(flow / W) >= x;
}

void task(){
	cin >> n >> m >> x;
	T = n - 1;
	for (int i = 0; i < m; ++i) {
		int a, b, c;
		cin >> a >> b >> c;
		--a;
		--b;
		pushRib(a, b, c);
	}
	double l = 0;
	double r = 1e6+1;
	for (int step = 0; step < 55; ++step) {
		W = (l + r) / 2;
		if (solve())
			l = W;
		else
			r = W;
	}
	cout << fixed << setprecision(10) << l * x;
}


// Smile please :)

#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <cctype>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <string>
#include <iomanip>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <map>
#include <list>
#include <bitset>
#include <climits>
#include <unordered_map>
#include <unordered_set>
using namespace std;

//#undef KVARK_DEBUG

#ifdef KVARK_DEBUG
	#include "../h/debug.h"
#else
#define dbg(...) (void(1));
#define dbg2(...) (void(1));
#define dbg3(...) (void(1));
#define dbg4(...) (void(1));
#define dbg5(...) (void(1));
#define dbgp(...) (void(1));
#define dbg_arr(...) (void(1));
#define dbg_vec(...) (void(1));
#endif

typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef pair<double, int> pdi;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > vvi;
typedef vector<vector<pii> > vvpii;
typedef vector<vector<long long> > vvl;
typedef vector<long long> vl;
typedef long long int llint;

#define ALL(v) (v.begin()), (v.end())
#define SZ(v) ((int)((v).size()))
#define endl "\n"

void task();

int main(){
#ifdef KVARK
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#else
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	srand(time(0));
#endif
//	ios_base::sync_with_stdio(0);

	task();

#ifdef KVARK_DEBUG
	my_debug::printProcessInfo();
#endif
	return 0;
}
const int INF = 0x3f3f3f3f;
const int N = 1e5+10;
const int M = 3e5+10;

struct Rib {
	int from;
	int to;
	double f;
	int c;
};

int n, m, x;
vi g[51];
int pt[51];
Rib e[510];
int esz = 0;
double W;
int S = 0;
int T = 0;
int d[51];

void pushRib(int a, int b, int c) {
	g[a].push_back(esz);
	e[esz++] = Rib{a, b, 0, c};
	g[b].push_back(esz);
	e[esz++] = Rib{b, a, 0, 0};
}

bool bfs() {
	memset(d, 0x3f, sizeof(d));
	d[S] = 0;
	queue<int> q;
	q.push(S);
	while (!q.empty()) {
		int v = q.front();
		q.pop();
		for (int i: g[v]) {
			Rib& r = e[i];
			if (d[r.to] == INF && r.c - r.f >= W) {
				d[r.to] = d[v] + 1;
				q.push(r.to);
			}
		}
	}
	return d[T] != INF;
}

double dfs(int v, double f) {
	if (v == T)
		return f;
	if (f < W)
		return 0;
	double r = 0;
	for (;pt[v] < g[v].size(); ++pt[v]) {
		Rib& rib = e[g[v][pt[v]]];
		if (d[v] + 1 == d[rib.to]) {
			double yet = int((rib.c - rib.f) / W) * W;
			double add = dfs(rib.to, min(f, yet));
			r += add;
			f -= add;
			rib.f += add;
			e[g[v][pt[v]]^1].f -= add;
			if (f < W)
				return r;
		}
	}
	return r;
}

bool solve() {
	double flow = 0;
	for (int i = 0; i < esz; ++i)
		e[i].f = 0;
	while (bfs()) {
		memset(pt, 0, sizeof(pt));
		flow += dfs(S, INF);
	}
	return flow / W >= x;
}

void task(){
	cin >> n >> m >> x;
	T = n - 1;
	for (int i = 0; i < m; ++i) {
		int a, b, c;
		cin >> a >> b >> c;
		--a;
		--b;
		pushRib(a, b, c);
	}
	double l = 0;
	double r = 1e6+1;
	while (r*x - l*x > 1e-6) {
		W = (l + r) / 2;
		if (solve())
			l = W;
		else
			r = W;
	}
	cout << fixed << setprecision(10) << l * x;
}


// Smile please :)

#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <cctype>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <string>
#include <iomanip>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <map>
#include <list>
#include <bitset>
#include <climits>
#include <unordered_map>
#include <unordered_set>
using namespace std;

//#undef KVARK_DEBUG

#ifdef KVARK_DEBUG
	#include "../h/debug.h"
#else
#define dbg(...) (void(1));
#define dbg2(...) (void(1));
#define dbg3(...) (void(1));
#define dbg4(...) (void(1));
#define dbg5(...) (void(1));
#define dbgp(...) (void(1));
#define dbg_arr(...) (void(1));
#define dbg_vec(...) (void(1));
#endif

typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef pair<double, int> pdi;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > vvi;
typedef vector<vector<pii> > vvpii;
typedef vector<vector<long long> > vvl;
typedef vector<long long> vl;
typedef long long int llint;

#define ALL(v) (v.begin()), (v.end())
#define SZ(v) ((int)((v).size()))
#define endl "\n"

void task();

int main(){
#ifdef KVARK
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#else
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	srand(time(0));
#endif
//	ios_base::sync_with_stdio(0);

	task();

#ifdef KVARK_DEBUG
	my_debug::printProcessInfo();
#endif
	return 0;
}
const int INF = 0x3f3f3f3f;
const int N = 1e5+10;
const int M = 3e5+10;

struct Rib {
	int from;
	int to;
	double f;
	int c;
};

int n, m, x;
vi g[51];
int pt[51];
Rib e[510*2];
int esz = 0;
double W;
int S = 0;
int T = 0;
int d[51];

void pushRib(int a, int b, int c) {
	g[a].push_back(esz);
	e[esz++] = Rib{a, b, 0, c};
	g[b].push_back(esz);
	e[esz++] = Rib{b, a, 0, 0};
}

bool bfs() {
	memset(d, 0x3f, sizeof(d));
	d[S] = 0;
	queue<int> q;
	q.push(S);
	while (!q.empty()) {
		int v = q.front();
		q.pop();
		for (int i: g[v]) {
			Rib& r = e[i];
			if (d[r.to] == INF && r.c - r.f >= W) {
				d[r.to] = d[v] + 1;
				q.push(r.to);
			}
		}
	}
	return d[T] != INF;
}

double dfs(int v, double f) {
	if (v == T)
		return f;
	if (f < W)
		return 0;
	double r = 0;
	for (;pt[v] < g[v].size(); ++pt[v]) {
		Rib& rib = e[g[v][pt[v]]];
		if (d[v] + 1 == d[rib.to]) {
			double yet = int((rib.c - rib.f) / W) * W;
			double add = dfs(rib.to, min(f, yet));
			r += add;
			f -= add;
			rib.f += add;
			e[g[v][pt[v]]^1].f -= add;
			if (f < W)
				return r;
		}
	}
	return r;
}

bool solve() {
	double flow = 0;
	for (int i = 0; i < esz; ++i)
		e[i].f = 0;
	while (bfs()) {
		memset(pt, 0, sizeof(pt));
		flow += dfs(S, INF);
	}
	return flow / W >= x;
}

void task(){
	cin >> n >> m >> x;
	T = n - 1;
	for (int i = 0; i < m; ++i) {
		int a, b, c;
		cin >> a >> b >> c;
		--a;
		--b;
		pushRib(a, b, c);
	}
	double l = 0;
	double r = 1e6+1;
	for (int step = 0; step < 50; ++step) {
		W = (l + r) / 2;
		if (solve())
			l = W;
		else
			r = W;
	}
	cout << fixed << setprecision(10) << l * x;
}


// Smile please :)

#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <cctype>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <string>
#include <iomanip>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <map>
#include <list>
#include <bitset>
#include <climits>
#include <unordered_map>
#include <unordered_set>
using namespace std;

//#undef KVARK_DEBUG

#ifdef KVARK_DEBUG
	#include "../h/debug.h"
#else
#define dbg(...) (void(1));
#define dbg2(...) (void(1));
#define dbg3(...) (void(1));
#define dbg4(...) (void(1));
#define dbg5(...) (void(1));
#define dbgp(...) (void(1));
#define dbg_arr(...) (void(1));
#define dbg_vec(...) (void(1));
#endif

typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef pair<double, int> pdi;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > vvi;
typedef vector<vector<pii> > vvpii;
typedef vector<vector<long long> > vvl;
typedef vector<long long> vl;
typedef long long int llint;

#define ALL(v) (v.begin()), (v.end())
#define SZ(v) ((int)((v).size()))
#define endl "\n"

void task();

int main(){
#ifdef KVARK
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#else
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	srand(time(0));
#endif
//	ios_base::sync_with_stdio(0);

	task();

#ifdef KVARK_DEBUG
	my_debug::printProcessInfo();
#endif
	return 0;
}
const int INF = 0x3f3f3f3f;
const int N = 1e5+10;
const int M = 3e5+10;

struct Rib {
	int from;
	int to;
	double f;
	int c;
};

int n, m, x;
vi g[51];
int pt[51];
Rib e[510*2];
int esz = 0;
double W;
int S = 0;
int T = 0;
int d[51];

void pushRib(int a, int b, int c) {
	g[a].push_back(esz);
	e[esz++] = Rib{a, b, 0, c};
	g[b].push_back(esz);
	e[esz++] = Rib{b, a, 0, 0};
}

bool bfs() {
	memset(d, 0x3f, sizeof(d));
	d[S] = 0;
	queue<int> q;
	q.push(S);
	while (!q.empty()) {
		int v = q.front();
		q.pop();
		for (int i: g[v]) {
			Rib& r = e[i];
			if (d[r.to] == INF && r.c - r.f >= W) {
				d[r.to] = d[v] + 1;
				q.push(r.to);
			}
		}
	}
	return d[T] != INF;
}

double dfs(int v, double f) {
	if (v == T)
		return f;
	if (f < W)
		return 0;
	double r = 0;
	for (;pt[v] < g[v].size(); ++pt[v]) {
		Rib& rib = e[g[v][pt[v]]];
		if (d[v] + 1 == d[rib.to]) {
			double yet = int((rib.c - rib.f) / W) * W;
			double add = dfs(rib.to, min(f, yet));
			r += add;
			f -= add;
			rib.f += add;
			e[g[v][pt[v]]^1].f -= add;
			if (f < W)
				return r;
		}
	}
	return r;
}

bool solve() {
	double flow = 0;
	for (int i = 0; i < esz; ++i)
		e[i].f = 0;
	while (bfs()) {
		memset(pt, 0, sizeof(pt));
		flow += dfs(S, INF);
	}
	return flow / W >= x;
}

void task(){
	cin >> n >> m >> x;
	T = n - 1;
	for (int i = 0; i < m; ++i) {
		int a, b, c;
		cin >> a >> b >> c;
		--a;
		--b;
		pushRib(a, b, c);
	}
	double l = 0;
	double r = 1e6+1;
	while (double(clock()) / CLOCKS_PER_SEC < 1.9) {
		W = (l + r) / 2;
		if (solve())
			l = W;
		else
			r = W;
	}
	cout << fixed << setprecision(10) << l * x;
}


// Smile please :)

#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <cctype>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <string>
#include <iomanip>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <map>
#include <list>
#include <bitset>
#include <climits>
#include <unordered_map>
#include <unordered_set>
using namespace std;

//#undef KVARK_DEBUG

#ifdef KVARK_DEBUG
	#include "../h/debug.h"
#else
#define dbg(...) (void(1));
#define dbg2(...) (void(1));
#define dbg3(...) (void(1));
#define dbg4(...) (void(1));
#define dbg5(...) (void(1));
#define dbgp(...) (void(1));
#define dbg_arr(...) (void(1));
#define dbg_vec(...) (void(1));
#endif

typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef pair<double, int> pdi;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > vvi;
typedef vector<vector<pii> > vvpii;
typedef vector<vector<long long> > vvl;
typedef vector<long long> vl;
typedef long long int llint;

#define ALL(v) (v.begin()), (v.end())
#define SZ(v) ((int)((v).size()))
#define endl "\n"

void task();

int main(){
#ifdef KVARK
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#else
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	srand(time(0));
#endif
//	ios_base::sync_with_stdio(0);

	task();

#ifdef KVARK_DEBUG
	my_debug::printProcessInfo();
#endif
	return 0;
}
const int INF = 0x3f3f3f3f;
const int N = 1e5+10;
const int M = 3e5+10;

#define double long double

struct Rib {
	int from;
	int to;
	double f;
	int c;
};

int n, m, x;
vi g[51];
int pt[51];
Rib e[510*2];
int esz = 0;
double W;
int S = 0;
int T = 0;
int d[51];

void pushRib(int a, int b, int c) {
	g[a].push_back(esz);
	e[esz++] = Rib{a, b, 0, c};
	g[b].push_back(esz);
	e[esz++] = Rib{b, a, 0, 0};
}

bool bfs() {
	memset(d, 0x3f, sizeof(d));
	d[S] = 0;
	queue<int> q;
	q.push(S);
	while (!q.empty()) {
		int v = q.front();
		q.pop();
		for (int i: g[v]) {
			Rib& r = e[i];
			if (d[r.to] == INF && r.c - r.f >= W) {
				d[r.to] = d[v] + 1;
				q.push(r.to);
			}
		}
	}
	return d[T] != INF;
}

double dfs(int v, double f) {
	if (v == T)
		return f;
	if (f < W)
		return 0;
	double r = 0;
	for (;pt[v] < g[v].size(); ++pt[v]) {
		Rib& rib = e[g[v][pt[v]]];
		if (d[v] + 1 == d[rib.to]) {
			double yet = llint((rib.c - rib.f) / W) * W;
			double add = dfs(rib.to, min(f, yet));
			r += add;
			f -= add;
			rib.f += add;
			e[g[v][pt[v]]^1].f -= add;
			if (f < W)
				return r;
		}
	}
	return r;
}

bool solve() {
	double flow = 0;
	for (int i = 0; i < esz; ++i)
		e[i].f = 0;
	while (bfs()) {
		memset(pt, 0, sizeof(pt));
		double s = dfs(S, INF);
		flow += s;
	}
	return flow / W >= x;
}

void task(){
	cin >> n >> m >> x;
	T = n - 1;
	for (int i = 0; i < m; ++i) {
		int a, b, c;
		cin >> a >> b >> c;
		--a;
		--b;
		pushRib(a, b, c);
	}
	double l = 0;
	double r = 1e6+1;
	for (int step = 0; step < 64; ++step) {
		W = (l + r) / 2;
		if (solve())
			l = W;
		else
			r = W;
	}
	cout << fixed << setprecision(10) << l * x;
}


// Smile please :)

#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <cctype>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <string>
#include <iomanip>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <map>
#include <list>
#include <bitset>
#include <climits>
#include <unordered_map>
#include <unordered_set>
using namespace std;

//#undef KVARK_DEBUG

#ifdef KVARK_DEBUG
	#include "../h/debug.h"
#else
#define dbg(...) (void(1));
#define dbg2(...) (void(1));
#define dbg3(...) (void(1));
#define dbg4(...) (void(1));
#define dbg5(...) (void(1));
#define dbgp(...) (void(1));
#define dbg_arr(...) (void(1));
#define dbg_vec(...) (void(1));
#endif

typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef pair<double, int> pdi;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > vvi;
typedef vector<vector<pii> > vvpii;
typedef vector<vector<long long> > vvl;
typedef vector<long long> vl;
typedef long long int llint;

#define ALL(v) (v.begin()), (v.end())
#define SZ(v) ((int)((v).size()))
#define endl "\n"

void task();

int main(){
#ifdef KVARK
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#else
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	srand(time(0));
#endif
//	ios_base::sync_with_stdio(0);

	task();

#ifdef KVARK_DEBUG
	my_debug::printProcessInfo();
#endif
	return 0;
}
const int INF = 0x3f3f3f3f;
const int N = 1e5+10;
const int M = 3e5+10;

struct Rib {
	int from;
	int to;
	double f;
	int c;
};

int n, m, x;
vi g[51];
int pt[51];
Rib e[510];
int esz = 0;
double W;
int S = 0;
int T = 0;
int d[51];

void pushRib(int a, int b, int c) {
	g[a].push_back(esz);
	e[esz++] = Rib{a, b, 0, c};
	g[b].push_back(esz);
	e[esz++] = Rib{b, a, 0, 0};
}

bool bfs() {
	memset(d, 0x3f, sizeof(d));
	d[S] = 0;
	queue<int> q;
	q.push(S);
	while (!q.empty()) {
		int v = q.front();
		q.pop();
		for (int i: g[v]) {
			Rib& r = e[i];
			if (d[r.to] == INF && r.c - r.f >= W) {
				d[r.to] = d[v] + 1;
				q.push(r.to);
			}
		}
	}
	return d[T] != INF;
}

double dfs(int v, double f) {
	if (v == T)
		return f;
	if (f < W)
		return 0;
	double r = 0;
	for (;pt[v] < g[v].size(); ++pt[v]) {
		Rib& rib = e[g[v][pt[v]]];
		if (d[v] + 1 == d[rib.to]) {
			double yet = int((rib.c - rib.f) / W) * W;
			double add = dfs(rib.to, min(f, yet));
			r += add;
			f -= add;
			rib.f += add;
			e[g[v][pt[v]]^1].f -= add;
			if (f < W)
				return r;
		}
	}
	return r;
}

bool solve() {
	double flow = 0;
	for (int i = 0; i < esz; ++i)
		e[i].f = 0;
	while (bfs()) {
		memset(pt, 0, sizeof(pt));
		flow += dfs(S, INF);
	}
	return flow / W >= x;
}

void task(){
	cin >> n >> m >> x;
	T = n - 1;
	for (int i = 0; i < m; ++i) {
		int a, b, c;
		cin >> a >> b >> c;
		--a;
		--b;
		pushRib(a, b, c);
	}
	double l = 0;
	double r = 1e6+1;
	while (r*x - l*x > 1e-7) {
		W = (l + r) / 2;
		if (solve())
			l = W;
		else
			r = W;
	}
	cout << fixed << setprecision(10) << l * x;
}