#include <bits/stdc++.h>
using namespace std;
const int V = 100;
const int E = 2000;
const int INF = 2e9;
double tol = 1e-6;
int n, m, x;
int start[V], succ[E], to[E];
long long cap[E], orig_cap[E];
int edge_counter = 0;
void add_edge(int u, int v, int w) {
  cap[edge_counter] = w, to[edge_counter] = v;
  succ[edge_counter] = start[u];
  start[u] = edge_counter;
  ++edge_counter;
}
int inv(int e) { return e ^ 1; }
int path[V];
void reset() { copy(begin(orig_cap), end(orig_cap), begin(cap)); }
int augment(int s, int t) {
  queue<int> q;
  fill_n(path, V, -1);
  q.push(s);
  path[s] = -2;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int e = start[u]; ~e; e = succ[e]) {
      if (cap[e] <= 0) continue;
      int v = to[e];
      if (path[v] == -1) {
        path[v] = e;
        q.push(v);
      }
    }
  }
  if (path[t] == -1) return 0;
  long long res = INF;
  for (int e = path[t]; e != -2; e = path[to[inv(e)]]) {
    res = min(res, cap[e]);
  }
  for (int e = path[t]; e != -2; e = path[to[inv(e)]]) {
    cap[e] -= res;
    cap[inv(e)] += res;
  }
  return (int)res;
}
int max_flow(int s, int t) {
  int res = 0, increase = 0;
  while ((increase = augment(s, t))) {
    res += increase;
  }
  return res;
}
bool solve(double f) {
  reset();
  for (int i = 0; i < 2 * m; ++i) {
    cap[i] = floor(cap[i] / f);
  }
  return max_flow(1, n) >= x;
}
int main() {
  cin.tie(nullptr);
  cin.sync_with_stdio(false);
  fill_n(start, V, -1);
  cin >> n >> m >> x;
  for (int i = 0; i < m; ++i) {
    int a, b, c;
    cin >> a >> b >> c;
    add_edge(a, b, c);
    add_edge(b, a, 0);
  }
  copy(begin(cap), end(cap), begin(orig_cap));
  double lo = 0, hi = 1e6;
  while ((hi - lo) * x > tol) {
    double mid = lo + (hi - lo) / 2;
    if (solve(mid)) {
      lo = mid;
    } else {
      hi = mid;
    }
  }
  cout.precision(10);
  cout << lo * x << '\n';
}
