Longest Shortest Path

Given a directed graph with edge lengths and per-unit lengthening prices, spend at most budget P to make the shortest s-t path as long as possible.

Hard8Shortest pathBinary searchGraphNo attempts yetTime limit10sMemory limit512 MB

Problem

You are given a directed graph and two vertices ss and tt. The graph can hold several edges between the same ordered pair of vertices, but it has no self loop.

Every edge ee has an initial length ded_e and a unit price cec_e. Paying xcex \cdot c_e changes the length of ee from ded_e to de+xd_e + x. Here xx is a real number that is at least 0, and it does not have to be an integer. An edge cannot be shortened.

Lengthen some edges so that the total payment is at most PP, and make the shortest path from ss to tt as long as possible. At least one path from ss to tt exists.

Input

The input is a single test case in the following format.

N M P s t
v1 u1 d1 c1
...
vM uM dM cM

The first line holds five integers NN, MM, PP, ss, and tt. NN (2N2002 \le N \le 200) is the number of vertices, MM (1M20001 \le M \le 2000) is the number of edges, PP (0P1060 \le P \le 10^6) is the budget you may spend, and ss and tt (1s,tN1 \le s, t \le N, sts \ne t) are the start and the end vertex of the path.

Each of the next MM lines holds four integers viv_i, uiu_i, did_i, and cic_i. There is an edge from viv_i to uiu_i (1vi,uiN1 \le v_i, u_i \le N, viuiv_i \ne u_i) whose initial length is did_i (1di101 \le d_i \le 10) and whose unit price is cic_i (1ci101 \le c_i \le 10).

Output

Print, on one line, the largest length of the shortest path from ss to tt that you can reach by lengthening edges within the budget PP.

Round the value at the eighth digit after the decimal point and print exactly seven digits after the decimal point, padded with zeros. A value that falls exactly halfway rounds up.