#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
template <typename T>
class Edmonds_Karp {
  long long int n;
  T neu, mval;
  vector<vector<T>> C;
  vector<vector<long long int>> G;

 public:
  Edmonds_Karp(long long int _n) : n{_n}, neu{(T)0} {
    G.resize(_n);
    C.resize(_n, vector<T>(_n));
    mval = numeric_limits<T>::max();
  }
  void Add_Edge(long long int u, long long int v, T flow) {
    if (u == v) return;
    C[u][v] = flow;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  long long int Bfs(long long int s, long long int t,
                    vector<long long int>& par) {
    queue<pair<long long int, T>> q;
    q.push({s, mval});
    while (!q.empty()) {
      long long int u = q.front().first;
      T flow = q.front().second;
      q.pop();
      for (long long int v : G[u]) {
        if (v == s or par[v] != -1 or C[u][v] == neu) {
          continue;
        }
        par[v] = u;
        long long int new_flow = min(flow, C[u][v]);
        if (v == t) {
          return new_flow;
        }
        q.push({v, new_flow});
      }
    }
    return neu;
  }
  T Maxflow(long long int s, long long int t) {
    T flow = 0;
    vector<long long int> par(n, -1);
    while (true) {
      T new_flow = Bfs(s, t, par);
      if (new_flow == neu) {
        break;
      }
      flow += new_flow;
      long long int u = t;
      while (u != s) {
        long long int v = par[u];
        C[v][u] -= new_flow;
        C[u][v] += new_flow;
        u = v;
      }
      par.assign(n, -1);
    }
    return flow;
  }
};
void solve() {
  long long int n;
  cin >> n;
  long long int m;
  cin >> m;
  long long int x;
  cin >> x;
  vector<array<long long int, 3>> edge(m);
  for (long long int i = 0; i < m; i++) {
    cin >> edge[i][0];
    edge[i][0]--;
    cin >> edge[i][1];
    edge[i][1]--;
    cin >> edge[i][2];
  }
  long double low = 0;
  long double high = 1e9;
  for (long long int i = 0; i < 100; i++) {
    long double mid = (low + high) / (long double)2;
    Edmonds_Karp<long long int> G(n);
    for (auto e : edge) {
      G.Add_Edge(e[0], e[1], (long long int)(e[2] / mid));
    }
    if (G.Maxflow(0, n - 1) >= x) {
      low = mid;
    } else {
      high = mid;
    }
  }
  long double avg = (low + high) / (long double)2;
  cout << fixed << setprecision(9) << (long double)x * avg << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  cerr << "Time : "
       << 1000 * ((long double)clock()) / (long double)CLOCKS_PER_SEC << "ms\n";
  return 0;
}
