#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T BM(T p, T e, T M) {
  long long int ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T mdINV(T a, T M) {
  return BM(a, M - 2, M);
}
template <class T>
inline T PW(T p, T e) {
  long long int ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p);
    p = (p * p);
  }
  return (T)ret;
}
template <class T>
string NTS(T Number) {
  stringstream ss;
  ss << Number;
  return ss.str();
}
template <class T>
T stringtonumber(const string &Text) {
  istringstream ss(Text);
  T result;
  return ss >> result ? result : 0;
}
template <class T>
bool ISLEFT(T a, T b, T c) {
  if (((a.first.first - b.first.first) * (b.second.second - c.second.second) -
       (b.first.first - c.first.first) * (a.second.second - b.second.second)) <
      0.0)
    return 1;
  else
    return 0;
}
int INF = 1500000001;
struct dinic_maxflow {
  struct edge {
    int a, b, cap, flow;
    edge(int _a, int _b, int _c, int _d) {
      a = _a, b = _b, cap = _c, flow = _d;
    }
  };
  int n, s, t, d[30001], ptr[30001], q[30001 * 10];
  vector<edge> e;
  vector<int> g[30001];
  void add_edge(int a, int b, int cap) {
    edge e1 = edge(a, b, cap, 0);
    edge e2 = edge(b, a, 0, 0);
    g[a].push_back((int)e.size());
    e.push_back(e1);
    g[b].push_back((int)e.size());
    e.push_back(e2);
  }
  bool bfs() {
    int qh = 0, qt = 0;
    q[qt++] = s;
    memset(d, -1, sizeof d);
    d[s] = 0;
    while (qh < qt && d[t] == -1) {
      int v = q[qh++];
      for (size_t i = 0; i < g[v].size(); ++i) {
        int id = g[v][i], to = e[id].b;
        if (d[to] == -1 && e[id].flow < e[id].cap) {
          q[qt++] = to;
          d[to] = d[v] + 1;
        }
      }
    }
    return d[t] != -1;
  }
  int dfs(int v, int flow) {
    if (!flow) return 0;
    if (v == t) return flow;
    for (; ptr[v] < (int)g[v].size(); ++ptr[v]) {
      int id = g[v][ptr[v]], to = e[id].b;
      if (d[to] != d[v] + 1) continue;
      int pushed = dfs(to, min(flow, e[id].cap - e[id].flow));
      if (pushed) {
        e[id].flow += pushed;
        e[id ^ 1].flow -= pushed;
        return pushed;
      }
    }
    return 0;
  }
  int dinic() {
    int flow = 0;
    for (;;) {
      if (!bfs()) break;
      memset(ptr, 0, sizeof ptr);
      while (int pushed = dfs(s, INF)) {
        flow += pushed;
        if (pushed == 0) break;
      }
    }
    return flow;
  }
  dinic_maxflow(int _n, int _s, int _t) {
    n = _n;
    s = _s;
    t = _t;
  }
};
int main() {
  int n, m, first;
  scanf("%d%d%d", &n, &m, &first);
  int ar[m * 3 + 4];
  for (int i = 0; i <= m - 1; i++) {
    scanf("%d%d%d", &ar[i * 3], &ar[i * 3 + 1], &ar[i * 3 + 2]);
  }
  double lo = 0;
  double hi = 2e18;
  double res = 0;
  for (int i = 1; i <= 400; i++) {
    double mid = (lo + hi) / 2;
    dinic_maxflow dm = dinic_maxflow(n, 1, n);
    for (int j = 0; j < m; j++) {
      double cost = min(2e9, (double)ar[j * 3 + 2] / mid);
      int ho = cost;
      dm.add_edge(ar[j * 3], ar[j * 3 + 1], ho);
    }
    if (dm.dinic() >= first) {
      lo = mid;
      res = mid * first;
    } else
      hi = mid;
  }
  cout << fixed << setprecision(10) << res << endl;
  return 0;
}
