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

import static java.lang.StrictMath.*;
import static java.util.stream.Collectors.*;

public class TaskD {

    private static final String INPUT_FILE = "input.txt";
    
    private static final String ONLINE_JUDGE = "ONLINE_JUDGE";

    public static void main(String[] args) {
        boolean oj = System.getProperty(ONLINE_JUDGE) != null;

        try {
            InputReader reader = new InputReader(oj ? System.in : new FileInputStream(INPUT_FILE));
            PrintWriter writer = new PrintWriter(System.out);
            new Solver(reader).run(writer);
            writer.close();
        }
        catch (IOException e) {
            new RuntimeException(e);
        }
    }
}

class Solver {

    public static final double EPS = 1e-12;

    public Solver(InputReader reader) throws IOException {
        n = reader.nextInt();        
        int m = reader.nextInt();
        x = reader.nextInt();

        dinic = new DinicFlow(n);
        tc = 0;
        for (int i = 0; i < m; ++i) {
            int a = reader.nextInt()-1;
            int b = reader.nextInt()-1;
            int c = reader.nextInt(); 
            tc += c;
            dinic.addEdge(a, b, c);
        }
    }

    private double tc;

    public void run(PrintWriter writer) {
        double l = 0, r = tc/x + 1;
        for (int i = 0; r-l > EPS && i < 1<<7; ++i) {
            double m = (l+r)*0.5;
            dinic.clear(m);
            if (dinic.fire(n, 0, n-1) >= x) {
                l = m;
            }
            else {
                r = m;
            }
        }
        writer.printf("%.9f\n", l*x);
    }

    private int n;
    private int x;

    private DinicFlow dinic;
}


class DinicEdge {

    public DinicEdge(int to, int capacity) {
        set(to, capacity);
    }

    public void set(int to, int capacity) {
        this.to = to;
        initCapacity = capacity;
        flow = 0;
    }

    int to;
    int capacity;
    int initCapacity;
    int flow;
}

class DinicFlow {
    
    public static final int INFINITY = 1_000_000_000;

    public DinicFlow(int maxN) {
        create(maxN);
    }

    public void addEdge(int from, int to, int capacity) {
        DinicEdge e1 = new DinicEdge(to, capacity);
        DinicEdge e2 = new DinicEdge(from, 0);
        graph[from].add(edge.size());
        edge.add(e1);
        graph[to].add(edge.size());
        edge.add(e2);
    }

    public int fire(int n, int source, int target) {

        this.n = n;
        this.source = source;
        this.target = target;

        int flow = 0;
        while (bfs()) {
            Arrays.fill(pointer, 0, n, 0);
            for (int pushed = 0; (pushed = dfs(source, INFINITY)) > 0;) {
                flow += pushed;
            }
        }
        return flow;
    }

    private boolean bfs() {
        int queueHead = 0;
        int queueTail = 1;
        queue[0] = source;
        Arrays.fill(distance, 0, n, -1);
        distance[source] = 0;
        while (queueHead < queueTail && distance[target] == -1) {
            int v = queue[queueHead++];
            for (int id: graph[v]) {
                DinicEdge e = edge.get(id);
                int to = e.to;
                if (distance[to] == -1 && e.flow < e.capacity) {
                    queue[queueTail++] = to;
                    distance[to] = distance[v] + 1;
                }
            }
        }
        return distance[target] != -1;
    }

    private int dfs(int v, int flow) {
        if (flow == 0) {
            return 0;
        }
        if (v == target) {
            return flow;
        }
        for (; pointer[v] < graph[v].size(); ++pointer[v]) {
            int id = graph[v].get(pointer[v]);
            DinicEdge e = edge.get(id);
            int to = e.to;
            if (distance[to] == distance[v] + 1) {
                int pushed = dfs(to, min(flow, e.capacity - e.flow));
                if (pushed != 0) {
                    e.flow += pushed;
                    edge.get(id^1).flow -= pushed;
                    return pushed;
                }
            }
        }
        return 0;
    }

    public void clear(double w) {
        for (DinicEdge e: edge) {
            e.capacity = (int) (e.initCapacity/w);
            e.flow = 0;
        }
    }

    private void create(int maxN) {
        distance = new int[maxN];
        pointer = new int[maxN];
        queue = new int[maxN];
        graph = new List[maxN];
        for (int i = 0; i < maxN; ++i) {
            graph[i] = new ArrayList<Integer>();
        }

        edge = new ArrayList<DinicEdge>();
    }

    private int n;
    private int source;
    private int target;

    private List<DinicEdge> edge;
    private List<Integer>[] graph;

    private int[] distance;
    private int[] pointer;
    private int[] queue;
   
}

class InputReader {
 	
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 1<<15);
        tokenizer = null;
    }

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

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

    public long nextLong() {
        return Long.parseLong(next());
    }

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

}