#include <bits/stdc++.h>
const int MAX_N = 63;
const double eps = 1e-12;
const int inf = (int)1e9 + 123;
using namespace std;
struct edge {
  int from, to;
  long long cp, flow;
  edge() {}
  edge(int from, int to, long long cp) : from(from), to(to), cp(cp), flow(0) {}
};
vector<edge> orig, q;
vector<int> g[MAX_N];
void add_edge(int u, int v, int cp) {
  g[u].push_back(int((orig).size()));
  orig.push_back(edge(u, v, cp));
  g[v].push_back(int((orig).size()));
  orig.push_back(edge(v, u, 0));
}
int d[MAX_N], ptr[MAX_N];
queue<int> Q;
bool bfs(int st, int fn) {
  for (int i = 2; i <= fn; i++) d[i] = inf;
  d[1] = 0;
  Q.push(1);
  while (!Q.empty()) {
    int v = Q.front();
    Q.pop();
    for (auto i : g[v])
      if (q[i].flow < q[i].cp && d[q[i].to] > d[q[i].from] + 1) {
        d[q[i].to] = d[q[i].from] + 1;
        Q.push(q[i].to);
      }
  }
  return d[fn] != inf;
}
long long dfs(int v, int target, long long cur_min = (long long)1e18) {
  if (v == target) return cur_min;
  while (ptr[v] < int((g[v]).size())) {
    int i = g[v][ptr[v]];
    if (d[q[i].to] == d[q[i].from] + 1 && q[i].flow < q[i].cp) {
      long long now = dfs(q[i].to, target, min(cur_min, q[i].cp - q[i].flow));
      if (now) {
        q[i].flow += now;
        q[i ^ 1].flow -= now;
        return now;
      }
    }
    ptr[v]++;
  }
  return 0;
}
long long max_flow(int st, int fn) {
  long long res = 0;
  while (bfs(st, fn)) {
    memset(ptr, 0, sizeof ptr);
    while (1) {
      long long now = dfs(st, fn);
      if (!now) break;
      res += now;
    }
  }
  return res;
}
int n, m, x;
bool check(double val) {
  if (val < eps) return 1;
  q = orig;
  for (auto &i : q) i.cp = (long long)(1.0 * i.cp / val);
  return max_flow(1, n) >= x;
}
int main() {
  scanf("%d%d%d", &n, &m, &x);
  for (int i = 1, u, v, c; i <= m; i++) {
    scanf("%d%d%d", &u, &v, &c);
    add_edge(u, v, c);
  }
  double l = 0.0, r = 1e6, mid;
  for (int it = 0; it < 200; it++) {
    mid = (l + r) / 2;
    if (check(mid))
      l = mid;
    else
      r = mid;
  }
  printf("%.10f", 1.0 * l * x);
  return 0;
}
