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.*;
import java.util.*;

import static java.lang.Math.min;

public class Main {
    private static final String S = "wew";

    private final InputReader in;
    private final PrintWriter out;

    public Main(final InputReader in, final PrintWriter out) {
        this.in = in;
        this.out = out;
    }

    private static PrintWriter getOutput(final String filename) throws IOException {
        if (filename == null || filename.isEmpty()) {
            return new PrintWriter(new OutputStreamWriter(System.out));
        } else {
            return new PrintWriter(new FileWriter(filename + ".out"));
        }
    }

    public static void main(final String[] args) throws NumberFormatException, IOException {
        final String filename = "";
        final long time = System.currentTimeMillis();
        try (final InputReader in = new InputReader(filename); final PrintWriter out = getOutput(filename)) {
            new Main(in, out).solve();
        }
//        System.err.println("Running time: " + (System.currentTimeMillis() - time));
    }

    private void solve() throws IOException {
        final int n = in.nextInt();
        final int m = in.nextInt();
        final long x = in.nextInt();

        final int[] a = new int[m];
        final int[] b = new int[m];
        final long[] c = new long[m];

        for (int i = 0; i < m; i++) {
            a[i] = in.nextInt() - 1;
            b[i] = in.nextInt() - 1;
            c[i] = in.nextInt();
        }

        double E = 1e-8;
        double l = 0;
        double r = 100000000;
        while (Math.abs(r - l) * x / Math.max(1, r) > E) {
            final double middle = (l + r) / 2;
            final Graph graph = new Graph(n);
            for (int i = 0; i < m; i++) {
                graph.addEdge(a[i], b[i], (long) Math.floor(c[i] / middle));
            }

            final long max = graph.maxflow();
            if (max >= x) {
                l = middle;
            } else {
                r = middle;
            }
        }

        out.println(String.format(Locale.ROOT, "%.15f", l * x));
    }

    private void assertTrue(final boolean t) {
        if (!t) throw new RuntimeException();
    }
}

class Graph {
    private static final int[] PTR = new int[70 * 70 * 60];
    private static final int[] D = new int[70 * 70 * 60];
    private static final int[] Q = new int[70 * 70 * 60];

    private final List<List<Edge>> edges;
    private final int S, T;

    Graph(final int n) {
        this.edges = new ArrayList<>(n);
        for (int i = 0; i < n; i++)
            this.edges.add(new ArrayList<>());
        this.S = 0;
        this.T = n - 1;
    }

    static class Edge {
        final int from, to;
        final long throughput;
        int used = 0;
        Edge reverse;

        private Edge(final int from, final int to, final long throughput) {
            this.from = from;
            this.to = to;
            this.throughput = throughput;
        }

        @Override
        public String toString() {
            return "(" + from + "-" + used + "/" + throughput + "-" + to + ")";
        }
    }

    public Edge addEdge(final int from, final int to, final long throughput) {
        final Edge e1 = new Edge(from, to, throughput);
        final Edge e2 = new Edge(to, from, 0);
        e1.reverse = e2;
        e2.reverse = e1;
        edges.get(from).add(e1);
        edges.get(to).add(e2);
        return e1;
    }

    private boolean bfs() {
        final int n = edges.size();
        int qh = 0, qt = 0;
        Q[qt++] = S;
        Arrays.fill(D, 0, n, -1);
        D[S] = 0;
        while (qh < qt && D[T] == -1) {
            int v = Q[qh++];
            for (final Edge edge : edges.get(v)) {
                final int to = edge.to;
                if (D[to] == -1 && edge.used < edge.throughput) {
                    Q[qt++] = to;
                    D[to] = D[v] + 1;
                }
            }
        }
        return D[T] != -1;
    }

    private long dfs(int v, long flow) {
        if (flow == 0) return 0;
        if (v == T) return flow;
        for (; PTR[v] < edges.get(v).size(); PTR[v]++) {
            final Edge edge = edges.get(v).get(PTR[v]);
            final int to = edge.to;
            if (D[to] != D[v] + 1) continue;
            long pushed = dfs(to, min(flow, edge.throughput - edge.used));
            if (pushed > 0) {
                edge.used += pushed;
                edge.reverse.used -= pushed;

                return pushed;
            }
        }
        return 0;
    }

    public long maxflow() {
        final int n = edges.size();
        long result = 0;
        for (; ; ) {
            if (!bfs()) break;
            Arrays.fill(PTR, 0, n, 0);
            long pushed;
            while ((pushed = dfs(S, Integer.MAX_VALUE)) > 0) {
                result += pushed;
            }
        }
        return result;
    }
}

class InputReader implements Closeable {
    private StringTokenizer st;
    private final BufferedReader in;

    public InputReader(final String filename) throws IOException {
        if (filename == null || filename.isEmpty())
            in = new BufferedReader(new InputStreamReader(System.in));
        else
            in = new BufferedReader(new FileReader(filename + ".in"));
    }

    public boolean hasNextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = in.readLine();
            if (line == null)
                return false;
            st = new StringTokenizer(line);
        }
        return true;
    }

    public String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = in.readLine();
            if (line == null)
                return null;
            st = new StringTokenizer(line);
        }
        return st.nextToken();
    }

    public String readLine() throws IOException {
        return in.readLine();
    }

    public int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(nextToken());
    }

    @Override
    public void close() throws IOException {
        in.close();
    }
}