Logo
(追記) (追記ここまで)

31080번 - City Brain 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
4 초 1024 MB411100.000%

문제

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 1ドル$m/s. Prof. Pang can increase the speed limit on a road by 1ドル$m/s with the cost of 1ドル$ dollar. Prof. Pang has $k$ dollars. He can spend any nonnegative integral amount of money on each road. If the speed limit on some road is $a$m/s, it takes 1ドル/a$ seconds for anyone to go through the road in either direction.

After Prof. Pang spent his money, Prof. Du starts to travel from city $s_1$ to city $t_1$ and Prof. Wo starts to travel from city $s_2$ to city $t_2$. 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 $s_1$ and $t_1$ are connected by at least one path and that $s_2$ and $t_2$ are connected by at least one path.

입력

The first line contains three integers $n,ドル $m,ドル $k$ (1ドル\le n \le 5000,ドル 0ドル\le m \le 5000,ドル 0ドル\le k\le 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 $m$ lines contains two integers $a,ドル $b$ (1ドル\le a, b\le n, a\neq b$) 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,ドル $t_1,ドル $s_2,ドル $t_2$ (1ドル\le s_1, t_1, s_2, t_2\le 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 10ドル^{-9}$.

제한

예제 입력 1

6 5 1
1 2
3 2
2 4
4 5
4 6
1 5 3 6

예제 출력 1

5.000000000000

예제 입력 2

1 0 100
1 1 1 1

예제 출력 2

0.000000000000

예제 입력 3

4 2 3
1 2
3 4
1 2 3 4

예제 출력 3

0.833333333333

힌트

출처

Contest > Open Cup > 2020/2021 Season > Stage 15, Grand Prix of China, Division 1 D번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /