#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:167772160000")
using namespace std;
long long cap[60][60];
long long adj[60][60];
int from[70];
bool vis[70];
int n;
long long flow() {
  long long ret = 0;
  while (1) {
    for (int i = 1; i <= (int)n; i++) vis[i] = 0;
    vis[1] = 1;
    queue<int> bfs;
    bfs.push(1);
    while (!bfs.empty()) {
      int a = bfs.front();
      bfs.pop();
      for (int i = 1; i <= (int)n; i++) {
        if (!vis[i] && cap[a][i] > 0) {
          vis[i] = 1;
          from[i] = a;
          bfs.push(i);
        }
      }
    }
    if (!vis[n]) break;
    vector<int> path;
    int a = n;
    path.push_back(n);
    while (a != 1) {
      path.push_back(from[a]);
      a = from[a];
    }
    long long fl = 1E18;
    for (int i = 0; i < (int)path.size() - 1; i++)
      fl = min(fl, cap[path[i + 1]][path[i]]);
    ret += fl;
    for (int i = 0; i < (int)path.size() - 1; i++) {
      cap[path[i + 1]][path[i]] -= fl;
      cap[path[i]][path[i + 1]] += fl;
    }
    if (fl == 0) break;
  }
  return ret;
}
int main() {
  cin >> n;
  long long m, x;
  cin >> m >> x;
  for (int i = 1; i <= (int)n; i++)
    for (int j = 1; j <= (int)n; j++) adj[i][j] = 0;
  for (int i = 0; i < (int)m; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    adj[a][b] = c;
  }
  double low = 0;
  double high = 1000000000000000;
  for (int k = 0; k < (int)100; k++) {
    double mid = (low + high) / 2;
    for (int i = 1; i <= (int)n; i++)
      for (int j = 1; j <= (int)n; j++) {
        if (mid == 0)
          cap[i][j] = x;
        else if (adj[i][j] / mid > x)
          cap[i][j] = x;
        else
          cap[i][j] = adj[i][j] / mid;
      }
    long long f = flow();
    if (f >= x)
      low = mid;
    else
      high = mid;
  }
  cout << fixed << setprecision(15) << low * x;
  return 0;
}
