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.ArrayList;
import java.util.Arrays;
import java.util.List;
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 ISAP1 isap = new ISAP1(MAXN);

    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));
    }
}

interface NetworkFlow {
    void init();
    void init(int source, int converge);
    void init(int source, int converge, int n);
    void addEdge(int from, int to, int cap);
    int maxFlow();
}


abstract class ISAP implements NetworkFlow {
    public final int INF;
    public final int MAXN;
    protected final int[] cnt;
    protected final int[] cur;
    protected final int[] path;
    protected final int[] dist;
    protected final int[] Q;
    protected int s, t, m, n, current_flow;

    public ISAP(int MAXN, int INF) {
        this.INF = INF;
        this.MAXN = MAXN;
        cnt = new int[MAXN];
        cur = new int[MAXN];
        path = new int[MAXN];
        dist = new int[MAXN];
        Q = new int[MAXN];
    }

    @Override
    public void init() {
        init(s, t, n);
    }

    @Override
    public void init(int source, int converge) {
        init(source, converge, n);
    }

    @Override
    public void init(int source, int converge, int n) {
        assert n <= MAXN : "n is bigger than maxn. " + n;
        s = source;
        t = converge;
        this.n = n;
        m = current_flow = 0;
    }
    abstract protected void BFS();
    abstract protected int augment();
}
class Edge {
    public int from, to, cap, flow;
    public Edge() {}

    public Edge(int from, int to, int cap, int flow) {
        set(from, to, cap, flow);
    }

    public void set(int from, int to, int cap,int flow) {
        this.from = from;
        this.to = to;
        this.cap = cap;
        this.flow = flow;
    }
}






class ISAP1 extends ISAP {
    protected final List<Edge> edges = new ArrayList<>();
    protected final List<Integer>[] G;

    public ISAP1(int MAXN, int INF) {
        super(MAXN, INF);
        G = new List[MAXN];
        for(int i=0; i < MAXN; ++i) G[i] = new ArrayList<>();
    }

    public ISAP1(int MAXN) {
        this(MAXN, 0x3f3f3f3f);
    }

    @Override
    public void init(int source, int converge, int N) {
        super.init(source, converge, N);
        edges.clear();
        for(int i=0; i < n; ++i) G[i].clear();
    }

    @Override
    public void addEdge(int from, int to, int cap) {
        edges.add(new Edge(from, to, cap, 0));
        edges.add(new Edge(to, from, 0, 0));
        G[from].add(m++);
        G[to].add(m++);
    }

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

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

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

            if( !flag ) {
                int d = n - 1;
                for(int i: G[o]) {
                    Edge e = edges.get(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] = 0;
                if( o != s ) o = edges.get(path[o]).from;
            }
        }
        return current_flow = ans;
    }

    @Override
    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[o]) {
                Edge e = edges.get(i);
                if( dist[e.to] == INF && e.cap == 0 ) {
                    dist[e.to] = dist[o] + 1;
                    Q[rear++] = e.to;
                }
            }
        }
    }

    @Override
    protected int augment() {
        int mif = INF;
        for(int o=t; o != s;) {
            Edge e = edges.get(path[o]);
            mif = Math.min(mif, e.cap-e.flow);
            o = e.from;
        }
        for(int o=t; o != s;) {
            edges.get(path[o]).flow += mif;
            edges.get(path[o]^1).flow -= mif;
            o = edges.get(path[o]).from;
        }
        return mif;
    }
}
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);
        }
    }
}