#!/usr/bin/env python3
from collections import defaultdict
from heapq import heappush, heappop

(n, m, T), edges = map(int, input().split()), defaultdict(list)
for x, y, l, v, w in (map(int, input().split()) for _ in range(m)):
    edges[x].append((y, l, v, w))
    edges[y].append((x, l, v, w))

q, dist, done = [(0, 1)], [1e18] * (n + 1), [False] * (n + 1)
dist[1] = 0
while q:
    t, curr = heappop(q)
    if curr == n: exit(print(t))
    if done[curr]: continue
    done[curr] = True
    for neigh, l, v, w in edges[curr]:
        new = t + l / (v if t < T else w)
        if new > T:  # t < T < new:
            new = T + (l - (T - t) * v) / w
        if new < dist[neigh]:
            dist[neigh] = new
            heappush(q, (new, neigh))
