Problem: Niwel is a little golden bear. As everyone knows, bears live in forests, but Niwel got tired of seeing all the trees so he decided to move to the city.

In the city, Niwel took on a job managing bears to deliver goods. The city that he lives in can be represented as a directed graph with n nodes and m edges. Each edge has a weight capacity. A delivery consists of a bear carrying weights with their bear hands on a simple path from node 1 to node n. The total weight that travels across a particular edge must not exceed the weight capacity of that edge.

Niwel has exactly x bears. In the interest of fairness, no bear can rest, and the weight that each bear carries must be exactly the same. However, each bear may take different paths if they like.

Niwel would like to determine, what is the maximum amount of weight he can deliver (it's the sum of weights carried by bears). Find the maximum weight.

Input

The first line contains three integers n, m and x (2 ≤ n ≤ 50, 1 ≤ m ≤ 500, 1 ≤ x ≤ 100 000) — the number of nodes, the number of directed edges and the number of bears, respectively.

Each of the following m lines contains three integers ai, bi and ci (1 ≤ ai, bi ≤ n, ai ≠ bi, 1 ≤ ci ≤ 1 000 000). This represents a directed edge from node ai to bi with weight capacity ci. There are no self loops and no multiple edges from one city to the other city. More formally, for each i and j that i ≠ j it's guaranteed that ai ≠ aj or bi ≠ bj. It is also guaranteed that there is at least one path from node 1 to node n.

Output

Print one real value on a single line — the maximum amount of weight Niwel can deliver if he uses exactly x bears. Your answer will be considered correct if its absolute or relative error does not exceed 10 - 6.

Namely: let's assume that your answer is a, and the answer of the jury is b. The checker program will consider your answer correct if <image>.

Examples

Input

4 4 3
1 2 2
2 4 1
1 3 1
3 4 2


Output

1.5000000000


Input

5 11 23
1 2 3
2 3 4
3 4 5
4 5 6
1 3 4
2 4 5
3 5 6
1 4 2
2 5 3
1 5 2
3 2 30


Output

10.2222222222

Note

In the first sample, Niwel has three bears. Two bears can choose the path <image>, while one bear can choose the path <image>. Even though the bear that goes on the path <image> can carry one unit of weight, in the interest of fairness, he is restricted to carry 0.5 units of weight. Thus, the total weight is 1.5 units overall. Note that even though Niwel can deliver more weight with just 2 bears, he must use exactly 3 bears on this day.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigmod(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 modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
template <class T>
inline T bpow(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;
}
int toInt(string s) {
  int sm;
  stringstream ss(s);
  ss >> sm;
  return sm;
}
int toLlint(string s) {
  long long int sm;
  stringstream ss(s);
  ss >> sm;
  return sm;
}
const double eps = 1e-9;
int ts, kk = 1;
vector<char> qq[205];
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 INF = 1000000007LL;
  int n, s, t, d[205], ptr[205], q[205 * 10];
  vector<edge> e;
  vector<int> g[205];
  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;
  }
};
dinic_maxflow *rs;
int n, m, x;
int cs[55][55], a[505], b[505], c[505];
int sz;
bool chk(double mx) {
  int i, j, u, v, k;
  for (i = 1; i <= sz; i++) {
    int ln = rs->g[i].size();
    for (j = 0; j < ln; j++) {
      k = rs->g[i][j];
      rs->e[k].flow = 0;
      u = rs->e[k].a;
      v = rs->e[k].b;
      u = (u + 1) / 2;
      v = (v + 1) / 2;
      int cst = floor((cs[u][v] * 1.0) / mx);
      if (qq[i][j] == 0) {
        rs->e[k].cap = 0;
      } else if (qq[i][j] == 1) {
        rs->e[k].cap = cst;
      } else if (qq[i][j] == 2) {
        rs->e[k].cap = 1000000007LL;
      }
    }
  }
  return (rs->dinic() >= x);
}
bool chk2(double mx) {
  int t, i, j, k;
  dinic_maxflow rs2(sz + 2, 1, sz);
  for (i = 0; i < m; i++) {
    t = a[i];
    j = b[i];
    int lo, hi, md;
    lo = 0;
    hi = x;
    while (lo <= hi) {
      md = (lo + hi) / 2;
      if (mx * md <= c[i])
        k = md, lo = md + 1;
      else
        hi = md - 1;
    }
    rs2.add_edge(t, j, k);
  }
  return (rs2.dinic() >= x);
}
int main() {
  int t, i, j, k;
  double lo, hi, md;
  lo = hi = 0.000001;
  scanf("%d%d%d", &n, &m, &x);
  sz = n;
  rs = new dinic_maxflow(sz + 2, 1, sz);
  for (i = 0; i < m; i++) {
    scanf("%d%d%d", &t, &j, &k);
    cs[t][j] = k;
    a[i] = t;
    b[i] = j;
    c[i] = k;
    hi = max(hi, k * 1.0);
    rs->add_edge((t * 2), (j * 2 - 1), 0);
    qq[(t * 2)].push_back(1);
    qq[(j * 2 - 1)].push_back(0);
  }
  for (i = 1; i <= n; i++) {
    rs->add_edge((i * 2 - 1), (i * 2), 0);
    qq[(i * 2 - 1)].push_back(2);
    qq[(i * 2)].push_back(0);
  }
  double qx = 0.0;
  t = 200;
  while (t--) {
    md = (lo + hi) / 2.0;
    if (chk2(md))
      lo = md, qx = md;
    else
      hi = md;
  }
  lo += hi;
  lo /= 2.0;
  cout << setprecision(10) << fixed << lo * x << '\n';
  return 0;
}