#include <bits/stdc++.h>
using namespace std;
struct EDGES {
  long long u, v, cap, flow, nextedge;
};
class MAXIMUM_FLOW {
 public:
  EDGES edge[100000];
  long long n, m, level[100000], Prev[100000], last[100000];
  queue<long long> Q;
  void init(long long N) {
    n = N;
    m = -1;
    for (int j = 0; j <= n; j++) last[j] = -1;
  }
  void addedge(long long a, long long b, long long c) {
    edge[++m].u = a, edge[m].v = b, edge[m].cap = c, edge[m].flow = 0,
    edge[m].nextedge = last[a], last[a] = m;
    edge[++m].u = b, edge[m].v = a, edge[m].cap = 0, edge[m].flow = 0,
    edge[m].nextedge = last[b], last[b] = m;
  }
  bool level_graph(long long src, long long snk) {
    for (int j = 0; j <= n; j++) level[j] = -1;
    int node, nxt;
    level[src] = 1;
    Q.push(src);
    while (!Q.empty()) {
      node = Q.front();
      Q.pop();
      for (int j = last[node]; j != -1; j = edge[j].nextedge) {
        nxt = edge[j].v;
        if (level[nxt] == -1 && edge[j].flow < edge[j].cap) {
          level[nxt] = level[node] + 1;
          Q.push(nxt);
        }
      }
    }
    return (level[snk] != -1);
  }
  long long dfs(long long node, long long snk, long long flow) {
    long long nxt, curflow;
    if (node == snk) return flow;
    for (long long &j = Prev[node]; j != -1; j = edge[j].nextedge) {
      nxt = edge[j].v;
      if (level[nxt] == level[node] + 1 && edge[j].flow < edge[j].cap) {
        curflow = dfs(nxt, snk, min(flow, edge[j].cap - edge[j].flow));
        if (curflow == 0) continue;
        edge[j].flow += curflow;
        edge[j ^ 1].flow -= curflow;
        return curflow;
      }
    }
    return 0;
  }
  long long MAX_FLOW(long long src, long long snk) {
    long long flow, ans = 0;
    while (level_graph(src, snk)) {
      for (long long j = 0; j <= n; j++) Prev[j] = last[j];
      while (flow = dfs(src, snk, (1 << 31) - 1)) {
        ans += flow;
      }
    }
    return ans;
  }
} g;
long long n, m, arr[105], x, node = 0;
EDGES C[600];
bool check(double m1) {
  long long r = 0;
  g.init(150);
  for (long long i = 0; i < m; i++) {
    long long u = C[i].u, v = C[i].v;
    long double c = C[i].cap;
    g.addedge(u, v, (long long)((long double)c / (long double)m1));
  }
  long long ans1 = g.MAX_FLOW(1, n);
  if (ans1 >= x) return 1;
  return 0;
}
int main() {
  cin >> n >> m >> x;
  for (long long i = 0; i < m; i++) {
    long long a, b, c;
    cin >> a >> b >> c;
    C[i].cap = c, C[i].u = a, C[i].v = b;
  }
  long double st = 0, nd = 1e9;
  for (long long i = 0; i < 100; i++) {
    long double m1 = (st + nd) / 2;
    if (check(m1))
      st = m1;
    else
      nd = m1;
  }
  st *= x;
  cout << setprecision(10) << fixed << st << endl;
}
