#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e3 + 5;
struct edge {
  int u, v, f, c;
  edge(int uu, int vv, int ff, int cc) {
    u = uu;
    v = vv;
    f = ff;
    c = cc;
  }
};
long long n, m, x, s, t, esq, dir, a[maxn], b[maxn], dist[maxn], ptr[maxn];
vector<vector<long long> > adj;
vector<edge> vec, aux_edge;
void add_edge(int u, int v, int w) {
  adj[u].push_back(vec.size());
  vec.push_back(edge(u, v, 0, w));
  adj[v].push_back(vec.size());
  vec.push_back(edge(v, u, 0, 0));
}
bool bfs() {
  memset(dist, -1, sizeof dist);
  queue<int> q;
  q.push(s);
  dist[s] = 0;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int i : adj[u]) {
      int v = vec[i].v, f = vec[i].f, c = vec[i].c;
      if (dist[v] == -1 and f < c) {
        dist[v] = dist[u] + 1;
        q.push(v);
      }
    }
  }
  return dist[t] != -1;
}
int dfs(int u, int flow) {
  if (!flow) return 0;
  if (u == t) return flow;
  for (; ptr[u] < adj[u].size(); ptr[u]++) {
    int i = adj[u][ptr[u]];
    int v = vec[i].v, f = vec[i].f, c = vec[i].c;
    if (dist[v] != dist[u] + 1) continue;
    int pushed = dfs(v, min(flow, c - f));
    if (pushed) {
      vec[i].f += pushed;
      vec[i ^ 1].f -= pushed;
      return pushed;
    }
  }
  return 0;
}
int solve(int mid) {
  vec.clear();
  adj.assign(esq + dir + 50, vector<long long>());
  s = 0;
  t = esq + dir + 1;
  for (int i = 1; i <= esq; i++) {
    add_edge(i + dir, t, a[i]);
  }
  for (int i = 1; i <= dir; i++) {
    add_edge(s, i, b[i]);
  }
  for (int i = 0; i < m; i++) {
    if (aux_edge[i].c <= mid) {
      add_edge(aux_edge[i].v, aux_edge[i].u + dir, 1e9);
    }
  }
  int res = 0;
  while (bfs()) {
    memset(ptr, 0, sizeof ptr);
    while (int pushed = dfs(s, 1e9)) res += pushed;
  }
  return res;
}
long long peso[55][55], peso2[55][55];
long long dfs_m(long long u, long long w, long long *vis) {
  if (u == t) return w;
  vis[u] = 1;
  for (long long v : adj[u]) {
    long long p = peso2[u][v];
    if (!vis[v] and p > 0) {
      long long r = dfs_m(v, min(w, p), vis);
      if (r) {
        peso2[u][v] -= r;
        peso2[v][u] += r;
        return r;
      }
    }
  }
  return 0;
}
void ajustaPeso(double val) {
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= n; j++) {
      peso2[i][j] = floor((double)peso[i][j] / val);
    }
  }
  peso2[s][1] = 1e9;
  peso2[n][t] = 1e9;
}
long long fluxo(double val) {
  long long f, res = 0;
  long long vis[55];
  memset(vis, 0, sizeof vis);
  ajustaPeso(val);
  while (f = dfs_m(s, 1e9, vis)) {
    res += f;
    memset(vis, 0, sizeof vis);
  }
  return (res >= x);
}
double fft() {
  double l = 0.00000001, r = 1e9;
  double mid;
  double res = 0;
  long long cnt = 0;
  while (cnt++ < 100) {
    mid = (l + r) / 2;
    if (fluxo(mid)) {
      res = max(res, mid);
      l = mid;
    } else {
      r = mid;
    }
  }
  return res;
}
int main() {
  cout.sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m >> x;
  s = 0;
  t = n + 1;
  adj.assign(n + 5, vector<long long>());
  for (long long i = 0; i < m; i++) {
    long long a, b, c;
    cin >> a >> b >> c;
    adj[a].push_back(b);
    adj[b].push_back(a);
    peso[a][b] = c;
  }
  adj[s].push_back(1);
  peso[s][1] = 1e9;
  adj[n].push_back(t);
  peso[n][t] = 1e9;
  printf("%.6f\n", x * fft());
  return 0;
}
