#include <bits/stdc++.h>
using namespace std;
const int N = 1111;
int cap[51][51], deg[51], adj[51][51];
int q[51], prv[51];
int dinic(int n, int s, int t) {
  int flow = 0;
  memset(deg, 0, sizeof(deg));
  for (int u = 0; u < n; u++)
    for (int v = 0; v < n; v++)
      if (cap[u][v] || cap[v][u]) adj[u][deg[u]++] = v;
  while (true) {
    memset(prv, -1, sizeof(prv));
    int qf = 0, qb = 0;
    prv[q[qb++] = s] = -2;
    while (qb > qf && prv[t] == -1)
      for (int u = q[qf++], i = 0, v; i < deg[u]; i++)
        if (prv[v = adj[u][i]] == -1 && cap[u][v]) prv[q[qb++] = v] = u;
    if (prv[t] == -1) break;
    for (int z = 0; z < n; z++)
      if (cap[z][t] && prv[z] != -1) {
        int bot = cap[z][t];
        for (int v = z, u = prv[v]; u >= 0; v = u, u = prv[v])
          bot = min(bot, cap[u][v]);
        if (!bot) continue;
        cap[z][t] -= bot;
        cap[t][z] += bot;
        for (int v = z, u = prv[v]; u >= 0; v = u, u = prv[v]) {
          cap[u][v] -= bot;
          cap[v][u] += bot;
        }
        flow += bot;
      }
  }
  return flow;
}
int a[N], b[N], c[N];
int main() {
  std::ios::sync_with_stdio(false);
  int n, m, x;
  cin >> n >> m >> x;
  for (int i = 0; i < m; ++i) {
    cin >> a[i] >> b[i] >> c[i];
    --a[i], --b[i];
  }
  double l = 1.0 / x, r = 1e6;
  for (int i = 0; i < 200; ++i) {
    double md = (l + r) / 2;
    for (int j = 0; j < m; ++j) {
      cap[a[j]][b[j]] = (int)(floor(c[j] / md) + 0.5);
    }
    if (dinic(n, 0, n - 1) >= x)
      l = md;
    else
      r = md;
  }
  cout << fixed << setprecision(10);
  cout << (double)(x * l) << endl;
  return 0;
}
