#include <bits/stdc++.h>
using namespace std;
const int maxn = 55, maxm = 505, INF = 0x3f3f3f3f;
double eps = 1e-9;
struct Edge {
  int u, v, w;
  Edge *inv;
  void init(int a, int b, int c) { u = a, v = b, w = c; }
} E[maxm << 1], *iter;
vector<Edge *> adj[maxn];
void AddEdge(int u, int v, int w) {
  Edge *a = iter++, *b = iter++;
  a->init(u, v, w);
  a->inv = b;
  b->init(v, u, 0);
  b->inv = a;
  adj[u].push_back(a);
  adj[v].push_back(b);
}
int N, M, X, S, T, u[maxm], v[maxm], w[maxm];
void init() {
  for (int i = 0; i < M; ++i) scanf("%d%d%d", &u[i], &v[i], &w[i]);
  S = 1, T = N;
}
int dis[maxn];
queue<int> Q;
bool bfs(int S, int T) {
  memset(dis, 0, sizeof(dis));
  dis[S] = 1;
  Q.push(S);
  int u;
  vector<Edge *>::iterator it;
  while (!Q.empty()) {
    u = Q.front();
    Q.pop();
    for (it = adj[u].begin(); it != adj[u].end(); ++it)
      if ((*it)->w && !dis[(*it)->v]) {
        Q.push((*it)->v);
        dis[(*it)->v] = dis[u] + 1;
      }
  }
  return dis[T];
}
int dfs(int u, int T, int c = INF) {
  if (u == T) return c;
  int ans = 0, t;
  vector<Edge *>::iterator it;
  for (it = adj[u].begin(); it != adj[u].end(); ++it)
    if (c && (*it)->w && dis[(*it)->v] == dis[u] + 1) {
      t = dfs((*it)->v, T, min(c, (*it)->w));
      (*it)->w -= t;
      c -= t;
      (*it)->inv->w += t;
      ans += t;
    }
  return ans;
}
int Dinic() {
  int ans = 0;
  while (bfs(S, T)) ans += dfs(S, T);
  return ans;
}
void work() {
  double L = 1.0 / 100000, R = 1000000, mid;
  int k = 100;
  while (k--) {
    mid = (L + R) / 2;
    for (int i = 1; i <= N; ++i) adj[i].clear();
    iter = E;
    for (int i = 0; i < M; ++i)
      AddEdge(u[i], v[i], int(min(100000.0, w[i] / mid)));
    if (Dinic() < X)
      R = mid;
    else
      L = mid;
  }
  printf("%.10f\n", X * mid);
}
int main() {
  int T;
  while (~scanf("%d%d%d", &N, &M, &X)) {
    init();
    work();
  }
  return 0;
}
