#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
const long long mod = 1000000007;
const int maxn = 505;
const double PI = acos(-1.0);
int n, m, x;
int u[maxn], v[maxn], cap[maxn];
struct ed {
  int to;
  int cap;
  int flow;
  int next;
} edge[4 * maxn];
int edgen;
int stac[maxn], head[maxn], dis[maxn], vis[maxn], pre[maxn];
void addedge(int u, int v, int cap) {
  edge[edgen].to = v;
  edge[edgen].cap = cap;
  edge[edgen].flow = 0;
  edge[edgen].next = head[u];
  head[u] = edgen++;
  edge[edgen].to = u;
  edge[edgen].cap = 0;
  edge[edgen].flow = 0;
  edge[edgen].next = head[v];
  head[v] = edgen++;
}
void init() {
  edgen = 0;
  memset(head, -1, sizeof(head));
  memset(edge, -1, sizeof(edge));
}
bool bfs(int S, int T) {
  int i, j, k, h, t;
  memset(dis, -1, sizeof(dis));
  dis[S] = 0;
  stac[0] = S;
  t = 1;
  for (h = 0; h < t; h++) {
    for (k = head[stac[h]]; k != -1; k = edge[k].next) {
      j = edge[k].to;
      if (dis[j] == -1 && edge[k].cap > edge[k].flow) {
        dis[j] = dis[stac[h]] + 1;
        stac[t++] = j;
      }
    }
  }
  if (dis[T] == -1) {
    return false;
  } else {
    return true;
  }
}
int dfs(int S, int T, int low) {
  if (S == T) return low;
  int i, j, k;
  int res = 0, tmp;
  for (i = head[S]; i != -1 && res < low; i = edge[i].next) {
    k = edge[i].to;
    if (dis[k] == dis[S] + 1 && edge[i].cap > edge[i].flow) {
      if (tmp = dfs(k, T, min(low - res, edge[i].cap - edge[i].flow))) {
        res += tmp;
        edge[i].flow += tmp;
        edge[i ^ 1].flow -= tmp;
      }
    }
  }
  if (res == 0) {
    dis[S] = -1;
  }
  return res;
}
int dinic(int s, int t) {
  int maxflow = 0, tmp;
  while (bfs(s, t)) {
    while (tmp = dfs(s, t, 0x33ffffff)) maxflow += tmp;
  }
  return maxflow;
}
int check(double w) {
  init();
  int i, j, k;
  for (i = 1; i <= m; i++) {
    addedge(u[i], v[i], (int)min(1.0 * cap[i] / w, 1.0 * x));
  }
  addedge(0, 1, x);
  addedge(n, n + 1, x);
  if (dinic(0, n + 1) == x) {
    return true;
  } else {
    return false;
  }
}
void solve() {
  int i, j, k;
  scanf("%d%d%d", &n, &m, &x);
  for (i = 1; i <= m; i++) {
    scanf("%d%d%d", &u[i], &v[i], &cap[i]);
  }
  double mid, le = 0, ri = 1e9;
  for (k = 0; k < 100; k++) {
    mid = (le + ri) / 2.0;
    if (check(mid)) {
      le = mid;
    } else {
      ri = mid;
    }
  }
  printf("%.7f", 1.0 * x * le);
}
int main() {
  solve();
  return 0;
}
