#include <bits/stdc++.h>
using namespace std;
int N, E, X;
bool vis[55];
long long oriWeight[55][55], weight[55][55];
long long getFlow(int u, long long cap) {
  vis[u] = 1;
  if (u == N) return cap;
  for (int v = 1; v <= N; v++) {
    if (!vis[v] && weight[u][v] > 0) {
      long long flow = getFlow(v, min(cap, weight[u][v]));
      weight[u][v] -= flow;
      weight[v][u] += flow;
      if (flow > 0) return flow;
    }
  }
  return 0;
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin >> N >> E >> X;
  for (int i = 1; i <= E; i++) {
    int u, v;
    long long w;
    cin >> u >> v >> w;
    oriWeight[u][v] = w;
  }
  double lo = 0, hi = 1e10;
  for (int bs = 0; bs < 100; bs++) {
    double mid = (lo + hi) / 2.0;
    for (int u = 1; u <= N; u++) {
      for (int v = 1; v <= N; v++) {
        weight[u][v] = oriWeight[u][v] / mid;
      }
    }
    long long maxFlow = 0, flow = -1;
    do {
      memset(vis, 0, sizeof(vis));
      flow = getFlow(1, LLONG_MAX);
      maxFlow += flow;
    } while (flow > 0);
    if (maxFlow >= X)
      lo = mid;
    else
      hi = mid;
  }
  cout << fixed << setprecision(6) << hi * X << endl;
  return 0;
}
