#include <bits/stdc++.h>
using namespace std;
const int N = 55;
const int inf = 1e9;
int st, ed, n, m, p, u, v, w;
int d[N], nxt[N];
long long f[N][N], W[N][N], c[N][N];
long long res;
bool bfs() {
  queue<int> q;
  for (int i = 1; i <= n; ++i) d[i] = inf;
  d[st] = 0;
  q.push(st);
  while (q.size()) {
    int u = q.front();
    q.pop();
    for (int v = 1; v <= n; ++v) {
      if (d[v] > d[u] + 1 && f[u][v] < c[u][v]) {
        d[v] = d[u] + 1;
        q.push(v);
      }
    }
  }
  return (d[ed] != inf);
}
long long dfs(int u, long long flow) {
  if (!flow || u == ed) return flow;
  for (int& v = nxt[u]; v <= n; ++v) {
    if (d[v] != d[u] + 1) continue;
    int nxt_flow = dfs(v, min(flow, c[u][v] - f[u][v]));
    if (nxt_flow) {
      f[u][v] += nxt_flow;
      f[v][u] -= nxt_flow;
      return nxt_flow;
    }
  }
  return 0;
}
void maxflow() {
  res = 0, st = 1, ed = n;
  while (bfs()) {
    for (int i = 1; i <= n; ++i) nxt[i] = 1;
    while (int flow = dfs(st, inf)) res += flow;
  }
}
void fix(double x) {
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      f[i][j] = 0;
      c[i][j] = (double)W[i][j] / x;
    }
  }
}
int main() {
  cin >> n >> m >> p;
  for (int i = 0; i < m; ++i) {
    cin >> u >> v >> w;
    W[u][v] = w;
  }
  double l = 0, r = 1e9;
  for (int i = 0; i < 100; ++i) {
    double mid = (l + r) / 2;
    fix(mid);
    maxflow();
    if (res >= p)
      l = mid;
    else
      r = mid;
  }
  cout << fixed << setprecision(6) << l * p;
}
