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>
#pragma comment(linker, "/STACK:66777216")
#pragma warning(disable : 4996)
#pragma hdrstop
const double EPS = 1e-9;
namespace std {}
namespace Random {}
inline bool is_digit(const char ch) { return (ch >= '0' && ch <= '9'); }
class IO {
 public:
  constexpr static const std::size_t kBufferSize = 1 << 18;
  IO()
      : read_bytes_count_(0),
        read_buffer_offset_(0),
        current_char_(0),
        eof_(false) {
    static_assert(kBufferSize > 32,
                  "Size of a buffer must be greater than 32 due to comparison "
                  "in IO::flush() method.");
  }
  ~IO() { flush(); }
  IO(const IO&) = delete;
  IO& operator=(const IO&) = delete;
  IO(const IO&&) = delete;
  IO& operator=(const IO&&) = delete;
  inline void shift_char();
  inline int32_t next_int();
  IO& operator>>(int32_t& x);
  inline void flush();

 private:
  using Buffer = std::array<char, kBufferSize>;
  Buffer read_buffer_;
  Buffer write_buffer_;
  std::size_t read_bytes_count_;
  std::size_t read_buffer_offset_;
  std::size_t write_buffer_offset_;
  bool eof_;
  char current_char_;
  inline void update_buffer();
  template <typename T>
  T read_number();
};
extern bool useFastIO;
extern std::istream* pin;
extern std::ostream* pout;
extern IO io;
inline int32_t next_int();
using namespace std;
IO io;
template <typename FlowSize>
class DinicFlow {
  struct Edge {
    std::size_t from, to;
    FlowSize cap;
    FlowSize flow;
  };

 public:
  DinicFlow(std::size_t n) : g(n), queue(n), pointer(n), used(n), d(n) {}
  void addEdge(std::size_t from, std::size_t to, FlowSize capacity) {
    return addTwoSidedEdge(from, to, capacity, 0);
  }
  void addTwoSidedEdge(std::size_t from, std::size_t to, FlowSize capacity,
                       FlowSize backwardCapacity) {
    Edge edge = {from, to, capacity, 0};
    g[from].push_back(edges.size());
    edges.push_back(edge);
    Edge backwardEdge = {to, from, backwardCapacity, 0};
    g[to].push_back(edges.size());
    edges.push_back(backwardEdge);
  }
  FlowSize findFlow(std::size_t from, std::size_t to,
                    FlowSize infinity = std::numeric_limits<FlowSize>::max()) {
    FlowSize flow = 0;
    while (bfs(from, to)) {
      memset(&pointer[0], 0, sizeof(std::size_t) * pointer.size());
      while (FlowSize pushed = dfs(from, to, infinity)) {
        flow += pushed;
      }
    }
    return flow;
  }

 private:
  bool bfs(std::size_t from, std::size_t to) {
    memset(&used[0], false, sizeof(char) * used.size());
    std::size_t qh = 0, qt = 0;
    queue[qt++] = from;
    used[from] = true;
    while (qh != qt) {
      std::size_t v = queue[qh++];
      for (std::size_t id : g[v]) {
        Edge& edge = edges[id];
        if (used[edge.to]) {
          continue;
        }
        if (edge.cap == edge.flow) {
          continue;
        }
        used[edge.to] = true;
        d[edge.to] = d[v] + 1;
        queue[qt++] = edge.to;
      }
    }
    return used[to];
  }
  FlowSize dfs(std::size_t v, std::size_t to, FlowSize mx) {
    if (mx == 0) {
      return 0;
    }
    if (v == to) {
      return mx;
    }
    for (std::size_t& i = pointer[v]; i < g[v].size(); ++i) {
      std::size_t id = g[v][i];
      Edge& e = edges[id];
      if (d[e.to] == d[v] + 1) {
        if (FlowSize pushed = dfs(e.to, to, std::min(mx, e.cap - e.flow))) {
          e.flow += pushed;
          edges[id ^ 1].flow -= pushed;
          return pushed;
        }
      }
    }
    return 0;
  }
  std::vector<std::vector<std::size_t>> g;
  std::vector<Edge> edges;
  std::vector<std::size_t> queue;
  std::vector<std::size_t> pointer;
  std::vector<char> used;
  std::vector<FlowSize> d;
};
struct Edge {
  int from, to, cap;
  Edge() {}
  void read() {
    io >> from >> to >> cap;
    --from, --to;
  }
};
void solve(istream& ins, ostream& out) {
  int n, m, x;
  io >> n >> m >> x;
  vector<Edge> e(m);
  for (int i = 0; i < m; ++i) {
    e[i].read();
  }
  double L = 0, R = 1e6;
  for (int iter = 0; iter < 60; ++iter) {
    double md = (L + R) / 2;
    if (md < EPS) {
      break;
    }
    DinicFlow<int64_t> flow(n);
    for (int i = 0; i < m; ++i) {
      int64_t cap = static_cast<int64_t>(e[i].cap / md + EPS);
      flow.addEdge(e[i].from, e[i].to, cap);
    }
    int64_t flow_value = flow.findFlow(0, n - 1);
    (flow_value < x ? R : L) = md;
  }
  out << fixed << setprecision(16) << L * x << endl;
}
extern class IO io;
bool useFastIO = false;
istream* pin;
ostream* pout;
int main() {
  srand(time(NULL));
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  istream& in = cin;
  useFastIO = true;
  ostream& out = cout;
  out << fixed << setprecision(16);
  pin = &in;
  pout = &out;
  solve(in, out);
  return 0;
}
template <typename T>
T IO::read_number() {
  bool is_negative = false;
  while (!eof_ && !is_digit(current_char_) &&
         (std::is_unsigned<T>() || current_char_ != '-')) {
    shift_char();
  }
  if (std::is_signed<T>() && current_char_ == '-') {
    is_negative = true;
    shift_char();
  }
  T result = 0;
  while (!eof_ && is_digit(current_char_)) {
    result = (result << 3) + (result << 1) + current_char_ - '0';
    shift_char();
  }
  return (is_negative ? result * -1 : result);
}
inline void IO::update_buffer() {
  if (read_buffer_offset_ == read_bytes_count_) {
    read_bytes_count_ = fread(&read_buffer_[0], sizeof(read_buffer_[0]),
                              read_buffer_.size(), stdin);
    if (read_bytes_count_ == 0) {
      eof_ = true;
      return;
    }
    read_buffer_offset_ = 0;
  }
}
inline void IO::shift_char() {
  update_buffer();
  current_char_ = read_buffer_[read_buffer_offset_++];
}
inline int32_t IO::next_int() { return read_number<int32_t>(); }
IO& IO::operator>>(int32_t& x) {
  x = ::next_int();
  return *this;
}
inline void IO::flush() {
  fwrite(&write_buffer_[0], sizeof(write_buffer_[0]), write_buffer_offset_,
         stdout);
  write_buffer_offset_ = 0;
}
inline int32_t next_int() {
  if (useFastIO) {
    return io.next_int();
  }
  int32_t ret;
  *pin >> ret;
  return ret;
}