#include <bits/stdc++.h>
using namespace std;
const int N = 1e2 + 7;
const int Inf = 1e9 + 7;
int n, m, x, w[N][N];
long long c[N][N], f[N][N];
int d[N], p[N];
bool BFS() {
  queue<int> Q;
  Q.push(1);
  memset(d, -1, sizeof d);
  d[1] = 0;
  while (Q.size()) {
    int u = Q.front();
    Q.pop();
    for (int v = 1; v <= n; ++v) {
      if (c[u][v] > f[u][v] && d[v] == -1) {
        d[v] = d[u] + 1;
        Q.push(v);
      }
    }
  }
  return d[n] != -1;
}
int DFS(int u, int flow) {
  if (u == n) return flow;
  for (int &v = p[u]; v <= n; ++v) {
    if (c[u][v] > f[u][v] && d[v] == d[u] + 1) {
      int w = DFS(v, min((long long)flow, c[u][v] - f[u][v]));
      if (w) {
        f[u][v] += w;
        f[v][u] -= w;
        return w;
      }
    }
  }
  return 0;
}
bool Check(long double l) {
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      c[i][j] = w[i][j] / l;
      f[i][j] = 0;
    }
  }
  int res = 0;
  while (BFS()) {
    memset(p, 0, sizeof p);
    while (1) {
      int q = DFS(1, Inf);
      if (q)
        res += q;
      else
        break;
    }
  }
  return (res >= x);
}
int main() {
  scanf("%d%d%d", &n, &m, &x);
  while (m--) {
    int u, v, l;
    scanf("%d%d%d", &u, &v, &l);
    w[u][v] = l;
  }
  long double l = 0, r = 2e6, res = 0;
  for (int k = 1; k <= 1000; ++k) {
    long double m = (l + r) / 2;
    if (Check(m)) {
      res = m;
      l = m + 1e-18;
    } else
      r = m - 1e-18;
  }
  cout << fixed << setprecision(8) << res * x;
  return 0;
}
