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.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Iterator;
import java.util.StringTokenizer;


public class Main {
    static final int INF = 0x3f3f3f3f;
    static final int MAXN = 500 + 10;
    static final Scanner in = new Scanner(System.in);

    static int N, M, X;
    static int[] a = new int[MAXN];
    static int[] b = new int[MAXN];
    static int[] c = new int[MAXN];
    static ISAP_Faster isap = new ISAP_Faster(MAXN, MAXN*MAXN*2);

    static boolean check(double x) {
        final int source = 0;
        final int converge = N+1;
        isap.init(source, converge, N+2);

        isap.addEdge(N, converge, INF);
        isap.addEdge(source, 1, X);

        for(int i=0; i < M; ++i) {
            int cap = (int) Math.min(X, c[i]/x);
            isap.addEdge(a[i], b[i], cap);
        }

        return isap.maxFlow() == X;
    }

    public static void main(String[] args) {
        N = in.nextInt();
        M = in.nextInt();
        X = in.nextInt();

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


        double lo = 0.0, hi = 1e9;
        for(int i=0; i < 70; ++i) {
            double mid = (lo+hi) / 2.0;
            if( check(mid) ) lo = mid;
            else hi = mid;
        }

        System.out.println(String.format("%.12f", lo*X));
    }
}

class ChainForward {
    public final int MAXN;
    public final int MAXE;
    public final int[] head;
    public final int[] next;
    public final int[] val;
    protected int size;

    public ChainForward(int MAXN, int MAXE) {
        this.MAXN = MAXN;
        this.MAXE = MAXE;
        this.head = new int[MAXN];
        this.next = new int[MAXE];
        this.val = new int[MAXE];
    }
    public void init() {
        size = 0;
        Arrays.fill(head, -1);
    }
    public void addEdge(int u, int v) {
        next[size] = head[u];
        head[u] = size;
        val[size++] = v;
    }

    public Iterable<Integer> forEach(int idx) {
        return forRemain(head[idx]);
    }

    public Iterable<Integer> forRemain(int idx) {
        return () -> new Iterator<Integer>() {
            int ct = idx;

            @Override
            public boolean hasNext() {
                return ct != -1;
            }

            @Override
            public Integer next() {
                int ret = val[ct];
                ct = next[ct];
                return ret;
            }
        };
    }

    public Iterable<Integer> forEachWithIndex(int idx) {
        return forRemainWithIndex(head[idx]);
    }

    public Iterable<Integer> forRemainWithIndex(int idx) {
        return () -> new Iterator<Integer>() {
            int ct = idx;

            @Override
            public boolean hasNext() {
                return ct != -1;
            }

            @Override
            public Integer next() {
                int ret = ct;
                ct = next[ct];
                return ret;
            }
        };
    }
}
class Edge {
    public int from, to, cap, flow;
    public Edge() {}
    public Edge(int from, int to, int cap, int flow) {
        this.from = from;
        this.to = to;
        this.cap = cap;
        this.flow = flow;
    }
}
class EdgesWrapper {
    public final int MAXE;
    public final Edge[] edges;
    protected int size;

    public EdgesWrapper(int MAXE) {
        this.MAXE = MAXE;
        edges = new Edge[MAXE];
        for(int i=0; i < edges.length; ++i)
            edges[i] = new Edge();
    }
    public void init() {
        size = 0;
    }
    public void addEdge(int from, int to, int cap, int flow) {
        Edge e = edges[size++];
        e.from = from;
        e.to = to;
        e.cap = cap;
        e.flow = flow;
    }
    public int size() {
        return size;
    }
}




class ISAP_Faster {
    public final int INF;
    public final int MAXN;
    public final int MAXE;
    public final int[] cnt;
    public final int[] cur;
    public final int[] path;
    public final int[] dist;
    protected final int[] Q;
    protected final EdgesWrapper edgesWrapper;
    protected final Edge[] edges;
    protected final ChainForward G;
    protected int s, t, n;

    public ISAP_Faster(int INF, int MAXN, int MAXE) {
        this.INF = INF;
        this.MAXN = MAXN;
        this.MAXE = MAXE * 2;

        cnt = new int[this.MAXN];
        cur = new int[this.MAXN];
        path = new int[this.MAXN];
        dist = new int[this.MAXN];
        Q = new int[this.MAXN];
        edgesWrapper = new EdgesWrapper(this.MAXE);
        edges = edgesWrapper.edges;
        G = new ChainForward(this.MAXN, this.MAXE);
    }

    public ISAP_Faster(int MAXN, int MAXE) {
        this(0x3f3f3f3f, MAXN, MAXE);
    }
    protected void initIASP() {
        edgesWrapper.init();
        G.init();
    }
    public void init(int source, int converge, int N) {
        assert N <= MAXN: "N is bigger than maxn. " + N;
        s = source;
        t = converge;
        n = N;
        initIASP();
    }
    public void init(int source, int converge) {
        init(source, converge, n);
    }
    public void init() {
        init(s, t, n);
    }
    public void addEdge(int from, int to, int cap) {
        G.addEdge(from, edgesWrapper.size());
        edgesWrapper.addEdge(from, to, cap, 0);
        G.addEdge(to, edgesWrapper.size());
        edgesWrapper.addEdge(to, from, 0, 0);
    }
    protected void BFS() {
        Arrays.fill(dist, 0, n, INF);
        dist[t] = 0;

        int front = 0, rear = 0;
        Q[rear++] = t;

        while( front < rear ) {
            int o = Q[front++];
            for(int i: G.forEach(o)) {
                Edge e = edges[i];
                if( dist[e.to] == INF && e.cap == 0 ) {
                    dist[e.to] = dist[o] + 1;
                    Q[rear++] = e.to;
                }
            }
        }
    }

    protected int augment() {
        int mif = INF;
        for(int o=t; o != s;) {
            Edge e = edges[path[o]];
            mif = Math.min(mif, e.cap-e.flow);
            o = e.from;
        }
        for(int o=t; o != s;) {
            edges[path[o]].flow += mif;
            edges[path[o]^1].flow -= mif;
            o = edges[path[o]].from;
        }
        return mif;
    }

    public int maxFlow() {
        BFS();
        System.arraycopy(G.head, 0, cur, 0, n);
        Arrays.fill(cnt, 0, n, 0);
        for(int i=0; i < n; ++i)
            if( dist[i] < n ) ++cnt[dist[i]];

        int ans = 0;
        for(int o=s; dist[o] < n;) {
            if( o == t ) {
                ans += augment();
                o = s;
            }

            boolean flag = false;
            for(int i: G.forRemainWithIndex(cur[o])) {
                int v = G.val[i];
                Edge e = edges[v];
                if( e.cap > e.flow && dist[o] == dist[e.to]+1 ) {
                    flag = true;
                    cur[o] = i;
                    path[e.to] = v;
                    o = e.to;
                    break;
                }
            }

            if( !flag ) {
                int d = n - 1;
                for(int i: G.forEach(o)) {
                    Edge e = edges[i];
                    if( e.cap > e.flow ) d = Math.min(d, dist[e.to]);
                }

                if( --cnt[dist[o]] == 0 ) break;
                ++cnt[ dist[o]=d+1 ];
                cur[o] = G.head[o];
                if( o != s ) o = edges[path[o]].from;
            }
        }
        return ans;
    }
}

class Scanner {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public Scanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in), 32768);
        tokenizer = null;
    }

    public Scanner(InputStream in, int size) {
        reader = new BufferedReader(new InputStreamReader(in), size);
        tokenizer = null;
    }

    public boolean hasNext() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (Exception e) {
                return false;
            }
        }
        return true;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}