#include <bits/stdc++.h>
using namespace std;
int z, dis[55], nb;
long long pho[55][55], ppho[55][55];
struct st {
  double num;
  st(double tmp) { num = tmp; }
};
bool operator<(const st &a, const st &b) { return a.num > b.num; }
multiset<st> me;
bool BFS() {
  nb++;
  int i, j;
  memset(dis, -1, sizeof(dis));
  int tmp;
  queue<int> q;
  dis[1] = 0;
  q.push(1);
  while (!q.empty()) {
    tmp = q.front();
    q.pop();
    for (int i = 1; i <= z; i++) {
      if (dis[i] < 0 && ppho[tmp][i]) {
        dis[i] = dis[tmp] + 1;
        q.push(i);
      }
    }
  }
  if (dis[z] > 0)
    return 1;
  else
    return 0;
}
long long findans(int x, long long low) {
  int i, a = 0;
  if (x == z) return low;
  for (i = 1; i <= z; i++) {
    if (ppho[x][i] > 0 && dis[i] == dis[x] + 1 &&
        (a = findans(i, min(low, ppho[x][i])))) {
      ppho[x][i] -= a;
      ppho[i][x] += a;
      return a;
    }
  }
  return 0;
}
int main() {
  int n, m, x, maxx;
  scanf("%d%d%d", &n, &m, &x);
  z = n;
  for (int i = 1; i <= m; i++) {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    pho[a][b] += c;
    maxx = max(maxx, c);
  }
  double l = 0, r = maxx, mid;
  for (int jishu = 0; jishu < 100; jishu++) {
    mid = (l + r) / 2;
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        ppho[i][j] = pho[i][j] / mid;
      }
    }
    long long tans, ans = 0;
    while (BFS()) {
      while (tans = findans(1, 0x3f3f3f3f3f3f3f3f)) {
        ans += tans;
      }
    }
    if (ans >= x)
      l = mid;
    else
      r = mid;
  }
  printf("%lf\n", mid * x);
}
