#include <bits/stdc++.h>
using namespace std;
int x_move[] = {0, 0, 1, -1};
int y_move[] = {1, -1, 0, 0};
int dist[55], p[55], start[55];
struct edge {
  long long v, rc, rev;
};
vector<edge> adj[55];
void add_edge(long long u, long long v, long long c) {
  edge e1{v, c, (long long)adj[v].size()};
  edge e2{u, 0, (long long)adj[u].size()};
  adj[u].push_back(e1);
  adj[v].push_back(e2);
}
void clr() {
  for (int i = 0; i < 55; i++) adj[i].clear();
}
bool bfs(int s, int t) {
  queue<int> q;
  memset(dist, -1, sizeof dist);
  dist[s] = 0;
  q.push(s);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int i = 0; i < adj[u].size(); i++) {
      int v = adj[u][i].v;
      long long rc = adj[u][i].rc;
      if (dist[v] == -1 && rc > 0) {
        dist[v] = dist[u] + 1;
        q.push(v);
      }
    }
  }
  return dist[t] != -1;
}
long long dfs(int s, int t, long long min_cap) {
  if (s == t) return min_cap;
  for (int &i = start[s]; i < adj[s].size(); i++) {
    edge &e = adj[s][i];
    if (dist[e.v] != dist[s] + 1 || e.rc < 1) continue;
    long long pushed = dfs(e.v, t, min(min_cap, e.rc));
    if (pushed) {
      e.rc -= pushed;
      adj[e.v][e.rev].rc += pushed;
      return pushed;
    }
  }
  return 0;
}
long long dinic(int s, int t) {
  long long max_flow = 0;
  while (bfs(s, t)) {
    memset(start, 0, sizeof start);
    while (long long flow = dfs(s, t, 1e15)) max_flow += flow;
  }
  return max_flow;
}
int main() {
  int t = 1, w, c, u, v, n, m, k;
  {
    clr();
    int x;
    cin >> n >> m >> x;
    pair<pair<int, int>, int> e[m];
    for (int i = 0; i < m; i++) {
      cin >> e[i].first.first >> e[i].first.second >> e[i].second;
    }
    double lo = 0, hi = 1e12, ans, mid;
    for (int i = 0; i < 100; i++) {
      mid = (lo + hi) / 2;
      clr();
      for (int j = 0; j < m; j++) {
        long long now = (long long)e[j].second / mid;
        if (now > 0) add_edge(e[j].first.first, e[j].first.second, now);
      }
      long long an = dinic(1, n);
      if (an >= x) {
        lo = mid;
        ans = mid;
      } else
        hi = mid;
    }
    printf("%.8lf\n", ans * x);
  }
}
