First Date
题号:NC202674
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
Special Judge, 64bit IO Format: %lld

题目描述

Jack finally meets a girl, and today is their first date. The city they live in consists of n vertices and m bidirectional roads. Each road has a standard time x_i to pass through and an influence factor y_i. Every day there is a congestion factor a, which is a uniformly distributed random variable between [0,1]. The time needed to pass the i-th road is . Note that is always not less than .

Jack wants to calculate the of minimum time between his home and their date place .

输入描述:

The first line contains four integers , , ,  (, , ) --- the number of vertices, the number of roads, Jack's home, and Jack's date place, respectively.
The following lines describe roads. Each line contains four integers u_i, v_i, x_i, y_i (, , ) --- denotes that there is a road between u_i and v_i, whose factors are x_i and y_i.

输出描述:

Output a real number --- the expected value of minimum time between  and .
The output is considered correct if it has an absolute error of at most .
示例1

输入

复制
2 1 1 2 
1 2 2 1

输出

复制
2.5