Marching Course

사람 수와 길이가 주어진 무방향 가중 그래프에서 1번 정점에서 출발해 길이 P 이내로 돌아오는 닫힌 보행 중, 단위 길이당 v/d의 합이 최대가 되는 경로를 찾는다.

어려움8그래프동적 계획법최단 경로그리디아직 제출이 없습니다시간 제한5초메모리 제한512 MB

문제

Since members of Kitafuji High School Brass Band Club succeeded in convincing their stern coach of their playing skills, they will be able to participate in Moon Light Festival as a marching band. This festival is a prelude in terms of appealing their presence for the coming domestic contest. Hence, they want to attract a festival audience by their performance.

Although this festival restricts performance time up to PP minutes, each team can freely determine their performance course from a provided area. The provided area consists of NN checkpoints, numbered 11 through NN, and MM bidirectional roads connecting two checkpoints. Kitafuji Brass Band already has the information about each road: its length and the expected number of people on its roadside. Each team must start at the checkpoint 11, and return back to the checkpoint 11 in PP minutes. In order to show the performance ability of Kitafuji Brass Band to a festival audience, their stern coach would like to determine their performance course so that many people listen their march as long as possible.

The coach uses "impression degree" to determine their best course. If they play mm minutes on the road with length dd and the expected number vv of people, then the impression degree will be m×v/dm \times v / d. The impression degree of a course is the sum of impression degree of their performance on the course. Marching bands must move at a constant speed during marching: 11 unit length per 11 minute. On the other hand, they can turn in the opposite direction at any time, any place including a point on a road. The impression degree is accumulated even if they pass the same interval two or more times.

Your task is to write a program to determine a course with the maximum impression degree in order to show the performance ability of Kitafuji Brass Band to an audience as much as possible.

입력

The input is formatted as follows.

$N$ $M$ $P$

$s_1$ $t_1$ $d_1$ $v_1$

$\ldots$

$s_M$ $t_M$ $d_M$ $v_M$

The first line contains three integers NN, MM, and PP: the number of checkpoints NN (2N2002 \le N \le 200), the number of roads MM (N1MN(N1)/2N-1 \le M \le N(N-1)/2), and the performance time PP (1P1,0001 \le P \le 1{,}000). The following MM lines represent the information about roads. The ii-th line of them contains four integers s_is\_i, t_it\_i, d_id\_i, and v_iv\_i: the ii-th road bidirectionally connects between checkpoints s_is\_i and t_it\_i (1s_i,t_iN1 \le s\_i, t\_i \le N, s_it_is\_i \neq t\_i) with length d_id\_i (1d_i1,0001 \le d\_i \le 1{,}000) and the expected number v_iv\_i (1v_i1,0001 \le v\_i \le 1{,}000) of people.

You can assume that any two checkpoints are directly or indirectly connected with one or more roads. You can also assume that there are no pair of roads having the same pair of endpoints.

출력

Output the maximum impression degree of a course for a PP-minute performance. The absolute error should be less than 10410^{-4}.