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 JAVA):

Solution:
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;

public class Main {
  private static class Task {
    void solve(FastScanner in, PrintWriter out) throws Exception {
      int N = in.nextInt();
      int M = in.nextInt();
      int X = in.nextInt();
      int[][] edges = new int[M][2];
      double[] costs = new double[M];
      for (int i = 0; i < M; i++) {
        int a = in.nextInt() - 1;
        int b = in.nextInt() - 1;
        costs[i] = in.nextDouble();
        edges[i] = new int[]{a, b};
      }

      double EPS = 0.00000001;
      double high = 1000000000.0, low = 0.0;
      double prevH = high, prevL = low;
      while ((high - low) * X > EPS) {
        double mid = (high + low) / 2.0;
        RelabelToFront f = new RelabelToFront(N);
        for (int i = 0; i < M; ++i) {
          long cap = (long) Math.min((costs[i] / mid), X);
          f.addEdge(edges[i][0], edges[i][1], cap);
        }
        long flow = f.maxFlow(0, N - 1);
        if (flow >= X) {
          low = mid;
        } else {
          high = mid;
        }
        if (prevH == high && prevL == low) break;
        prevH = high;
        prevL = low;
      }
      out.println((high + low) / 2.0 * X);
    }

    class RelabelToFront {
      class Edge {
        int from, to, rev;
        long flow, cap;
        Edge(int from, int to, long cap, int rev) {
          this.from = from;
          this.to = to;
          this.cap = cap;
          this.rev = rev;
          this.flow = 0;
        }
      }

      int N;
      ArrayList<ArrayList<Edge>> graph = new ArrayList<>();
      long[] excess;
      int[] height;
      int[] seen;
      PriorityQueue<int[]> queue = new PriorityQueue<int[]>(new Comparator<int[]>() {
        @Override
        public int compare(int[] o1, int[] o2) {
          return -Integer.compare(o1[0], o2[0]);
        }
      });

      RelabelToFront(int N) {
        this.N = N;
        for (int i = 0; i < N; i++) graph.add(new ArrayList<Edge>());
        excess = new long[N];
        height = new int[N];
        seen = new int[N];
      }

      void addEdge(int from, int to, long cap) {
        graph.get(from).add(new Edge(from, to, cap, graph.get(to).size()));
        graph.get(to).add(new Edge(to, from, 0, graph.get(from).size() - 1));
      }

      private void push(Edge e) {
        int u = e.from;
        int v = e.to;

        long send = Math.min(excess[u], e.cap - e.flow);
        e.flow += send;
        graph.get(v).get(e.rev).flow -= send;
        excess[u] -= send;
        excess[v] += send;

        if (excess[v] > 0) queue.add(new int[]{height[v], v});
        if (excess[u] > 0) queue.add(new int[]{height[u], u});
      }

      private void relabel(int u) {
        int minHeight = N * 2;
        for (Edge e : graph.get(u))
          if (e.cap - e.flow > 0)
            minHeight = Math.min(minHeight, height[e.to]);
        height[u] = minHeight + 1;

        queue.add(new int[]{height[u], u});
      }

      private void discharge(int u) {
        while (excess[u] > 0) {
          if (seen[u] < graph.get(u).size()) {
            Edge e = graph.get(u).get(seen[u]);
            if (e.cap - e.flow > 0 && height[u] == height[e.to] + 1)
              push(e);
            else
              seen[u] += 1;
          } else {
            relabel(u);
            seen[u] = 0;
          }
        }
      }

      long maxFlow(int source, int sink) {
        height[source] = N;
        for (Edge e : graph.get(source)) {
          excess[source] += e.cap;
          push(e);
        }

        while (!queue.isEmpty()) {
          int[] q = queue.poll();
          int u = q[1];
          if (u == source || u == sink) continue;
          discharge(u);
        }

        long maxFlow = 0;
        for (Edge e : graph.get(source)) maxFlow += e.flow;

        return maxFlow;
      }
    }
  }

  /**
   * ここから下はテンプレートです。
   */
  public static void main(String[] args) throws Exception {
    OutputStream outputStream = System.out;
    FastScanner in = new FastScanner();
    PrintWriter out = new PrintWriter(outputStream);
    Task solver = new Task();
    solver.solve(in, out);
    out.close();
  }
  private static class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int bufferLength = 0;

    private boolean hasNextByte() {
      if (ptr < bufferLength) {
        return true;
      } else {
        ptr = 0;
        try {
          bufferLength = in.read(buffer);
        } catch (IOException e) {
          e.printStackTrace();
        }
        if (bufferLength <= 0) {
          return false;
        }
      }
      return true;
    }

    private int readByte() {
      if (hasNextByte()) return buffer[ptr++];
      else return -1;
    }

    private static boolean isPrintableChar(int c) {
      return 33 <= c && c <= 126;
    }

    private void skipUnprintable() {
      while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
    }

    boolean hasNext() {
      skipUnprintable();
      return hasNextByte();
    }

    public String next() {
      if (!hasNext()) throw new NoSuchElementException();
      StringBuilder sb = new StringBuilder();
      int b = readByte();
      while (isPrintableChar(b)) {
        sb.appendCodePoint(b);
        b = readByte();
      }
      return sb.toString();
    }

    long nextLong() {
      if (!hasNext()) throw new NoSuchElementException();
      long n = 0;
      boolean minus = false;
      int b = readByte();
      if (b == '-') {
        minus = true;
        b = readByte();
      }
      if (b < '0' || '9' < b) {
        throw new NumberFormatException();
      }
      while (true) {
        if ('0' <= b && b <= '9') {
          n *= 10;
          n += b - '0';
        } else if (b == -1 || !isPrintableChar(b)) {
          return minus ? -n : n;
        } else {
          throw new NumberFormatException();
        }
        b = readByte();
      }
    }

    double nextDouble() {
      return Double.parseDouble(next());
    }

    double[] nextDoubleArray(int n) {
      double[] array = new double[n];
      for (int i = 0; i < n; i++) {
        array[i] = nextDouble();
      }
      return array;
    }

    double[][] nextDoubleMap(int n, int m) {
      double[][] map = new double[n][];
      for (int i = 0; i < n; i++) {
        map[i] = nextDoubleArray(m);
      }
      return map;
    }

    public int nextInt() {
      return (int) nextLong();
    }

    public int[] nextIntArray(int n) {
      int[] array = new int[n];
      for (int i = 0; i < n; i++) array[i] = nextInt();
      return array;
    }

    public long[] nextLongArray(int n) {
      long[] array = new long[n];
      for (int i = 0; i < n; i++) array[i] = nextLong();
      return array;
    }

    public String[] nextStringArray(int n) {
      String[] array = new String[n];
      for (int i = 0; i < n; i++) array[i] = next();
      return array;
    }

    public char[][] nextCharMap(int n) {
      char[][] array = new char[n][];
      for (int i = 0; i < n; i++) array[i] = next().toCharArray();
      return array;
    }

    public int[][] nextIntMap(int n, int m) {
      int[][] map = new int[n][];
      for (int i = 0; i < n; i++) {
        map[i] = nextIntArray(m);
      }
      return map;
    }
  }
}