#include <bits/stdc++.h>
using namespace std;
int n, m, x, cnt;
int vis[6000], dis[6000], cur[6000], head[6000];
int u[6000], v[6000], cap[6000];
struct node {
  int u, v, cap, flow, next;
} edge[1000000];
void add(int a, int b, int c) {
  node E = {a, b, c, 0, head[a]};
  edge[cnt] = E;
  head[a] = cnt++;
  node E1 = {b, a, 0, 0, head[b]};
  edge[cnt] = E1;
  head[b] = cnt++;
}
bool BFS(int s, int t) {
  queue<int> q;
  memset(vis, 0, sizeof(vis));
  memset(dis, -1, sizeof(dis));
  q.push(s);
  vis[s] = 1;
  dis[s] = 0;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int i = head[u]; i != -1; i = edge[i].next) {
      node E = edge[i];
      if (E.cap > E.flow && !vis[E.v]) {
        vis[E.v] = 1;
        dis[E.v] = dis[E.u] + 1;
        if (E.v == t) return true;
        q.push(E.v);
      }
    }
  }
  return false;
}
int DFS(int x, int a, int t) {
  if (a == 0 || x == t) return a;
  int flow = 0, f;
  for (int &i = cur[x]; i != -1; i = edge[i].next) {
    node &E = edge[i];
    if (dis[x] + 1 == dis[E.v] &&
        (f = DFS(E.v, min(E.cap - E.flow, a), t)) > 0) {
      a -= f;
      flow += f;
      edge[i].flow += f;
      edge[i ^ 1].flow -= f;
      if (a == 0) break;
    }
  }
  return flow;
}
int MAXflow(int ss, int t) {
  int flow = 0;
  while (BFS(ss, t)) {
    memcpy(cur, head, sizeof(head));
    flow += DFS(ss, 0x3f3f3f3f, t);
  }
  return flow;
}
bool judge(double mi) {
  cnt = 0;
  memset(head, -1, sizeof(head));
  for (int i = 0; i < m; i++)
    add(u[i], v[i], (int)min(x * 1.0, cap[i] * 1.0 / mi));
  return MAXflow(1, n) >= x;
}
int main() {
  while (scanf("%d%d%d", &n, &m, &x) != EOF) {
    memset(u, 0, sizeof(u));
    memset(v, 0, sizeof(v));
    memset(cap, 0, sizeof(cap));
    for (int i = 0; i < m; i++) scanf("%d%d%d", &u[i], &v[i], &cap[i]);
    double l = 0, r = 1e10, mid;
    double ans = 0;
    for (int i = 0; i <= 100; i++) {
      mid = (l + r) / 2;
      if (judge(mid)) {
        ans = mid;
        l = mid;
      } else
        r = mid;
    }
    printf("%.10lf\n", ans * x);
  }
  return 0;
}
