#include <bits/stdc++.h>
using namespace std;
int n, m, b;
const double eps = 1e-12;
const int N = 55;
const int M = 505;
int u[M], v[M], c[M];
int S, T;
int tot, hd[N], th[M << 2], nx[M << 2], f[M << 2];
const int INF = 1e9;
int dd[N], vv[N];
void add(int x, int y, int flow) {
  ++tot;
  th[tot] = y;
  nx[tot] = hd[x];
  hd[x] = tot;
  f[tot] = flow;
  ++tot;
  th[tot] = x;
  nx[tot] = hd[y];
  hd[y] = tot;
  f[tot] = 0;
}
int sap(int x, int flow) {
  if (x == T) return flow;
  int now = 0;
  for (int i = hd[x]; i; i = nx[i]) {
    int p = th[i];
    if (f[i] > 0 && dd[x] == dd[p] + 1) {
      int t = sap(p, min(f[i], flow - now));
      f[i] -= t;
      f[i ^ 1] += t;
      now += t;
      if (now == flow) return now;
      if (dd[S] >= T) return now;
    }
  }
  --vv[dd[x]];
  if (!vv[dd[x]]) dd[S] = T;
  ++dd[x];
  ++vv[dd[x]];
  return now;
}
int main() {
  scanf("%d%d%d", &n, &m, &b);
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d%d", &u[i], &v[i], &c[i]);
  }
  double l = 0, r = 1e6 + 1;
  for (int rep = 0; rep < 100; ++rep) {
    double mid = (l + r) / 2.;
    S = 1, T = n;
    tot = 1;
    memset(hd, 0, sizeof(hd));
    for (int i = 1; i <= m; ++i)
      add(u[i], v[i], (int)min(b + eps, ((double)c[i] / mid)));
    memset(vv, 0, sizeof(vv));
    memset(dd, 0, sizeof(dd));
    int res = 0;
    vv[S] = T;
    while (dd[S] < T) {
      res += sap(S, INF);
    }
    if (res >= b)
      l = mid;
    else
      r = mid;
  }
  printf("%.8f\n", l * b);
  return 0;
}
