#6. 「2020 AEC Final」D - City Brain
「2020 AEC Final」D - City Brain
题目描述
Prof. Pang works for the City Brain program of Capital Grancel. The road network of Grancel can be represented by an undirected graph. Initially, the speed limit on each road is . Prof. Pang can increase the speed limit on a road by with the cost of dollar. Prof. Pang has dollars. He can spend any nonnegative integral amount of money on each road. If the speed limit on some road is , it takes seconds for anyone to go through the road in either direction.
After Prof. Pang spent his money, Prof. Du starts to travel from city to city and Prof. Wo starts to travel from city to city . Help Prof. Pang to spend his money wisely to minimize the sum of minimum time of Prof. Du's travel and Prof. Wo's travel. It is guaranteed that and are connected by at least one path and that and are connected by at least one path.
输入格式
The first line contains three integers ($1 \leq n \leq 5000, 0 \leq m \leq 5000, 0 \leq k \leq 10^9$ ) separated by single spaces denoting the number of vertices, the number of edges in the graph and the number of dollars Prof. Pang has.
Each of the following 𝑚𝑚 lines contains two integers () separated by a single space denoting the two endpoints of one road. There can be multiple roads between the same pair of cities.
The following line contains four integers$ s_1 , 𝑡_1 , s_2 , t_2 (1 \leq s_1,t_1, s_2,t_2 \leq n ) $ separated by single spaces denoting the starting vertices and ending vertices of Prof. Du and Prof. Wo's travels.
输出格式
Output one decimal in the only line -- the minimum sum of Prof. Du's travel time and Prof. Wo's travel time. The answer will be considered correct if its absolute or relative error does not exceed
样例
输入
1 0 100
1 1 1 1
输出
0.00000000000000019260817