#include <bits/stdc++.h>
using namespace std;
double d[100], w[100][100], e[100][100];
vector<int> a[100];
int l1[100];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m, x;
  cin >> n >> m >> x;
  double r = 0;
  for (int i = 1; i <= m; i++) {
    int x, y;
    double z;
    cin >> x >> y >> z;
    a[x].push_back(y);
    w[x][y] = z;
    r = max(r, z);
  }
  double l = 0;
  for (int zz = 1; zz <= 80; zz++) {
    double mid = (l + r) / (double)2;
    int t = 0;
    for (int i = 1; i <= n; i++) {
      for (int j = 0; j < a[i].size(); j++) {
        e[i][a[i][j]] = w[i][a[i][j]];
      }
    }
    while (t <= x) {
      for (int i = 1; i <= n; i++) d[i] = 0;
      d[1] = 10000000;
      set<pair<double, int> > s;
      s.insert(make_pair(-d[1], 1));
      while (!s.empty()) {
        int u = s.begin()->second;
        s.erase(s.begin());
        for (int j = 0; j < a[u].size(); j++) {
          int h = a[u][j];
          if (d[h] < min(d[u], e[u][h])) {
            l1[h] = u;
            s.erase(make_pair(-d[h], h));
            d[h] = min(d[u], e[u][h]);
            s.insert(make_pair(-d[h], h));
          }
        }
      }
      if (d[n] >= mid) {
        int r = d[n] / mid;
        double h = r * mid;
        t += r;
        if (t >= x) break;
        int o = n;
        while (o != 1) {
          int p = l1[o];
          e[p][o] -= h;
          o = p;
        }
      } else
        break;
    }
    if (t >= x)
      l = mid;
    else
      r = mid;
  }
  l = l * x;
  printf("%.12lf\n", (l));
}
