#!/usr/bin/env pypy3 from heapq import heappush, heappop # Compute how long it takes to drive from start to finish on a given road at a # certain point in time. def single_travel(l, t, cur_t, v1, v2): # If the current time is larger than the limit increase, drive constant # speed. if cur_t >= t: return l / v2 # If you can't reach the next point before the limit increase, drive # constant speed. if (t - cur_t) * v1 >= l: return l / v1 # Find out when where the limit increases. low_speed_dist = (t - cur_t) * v1 rest_time = (l - low_speed_dist) / v2 return t - cur_t + rest_time def dijkstra(adj, start, end, t): heap = [(0, start)] # Make infinity very big times = [10**100] * len(adj) times[start] = 0 while heap: time, x = heappop(heap) if times[x] < time: continue for y, l, v1, v2 in adj[x]: if times[x] + single_travel(l, t, times[x], v1, v2) < times[y]: times[y] = times[x] + single_travel(l, t, times[x], v1, v2) heappush(heap, (times[y], y)) return times[end] def main(): n, m, t = (int(x) for x in input().split()) # The adjacency matrix contains in each row a tuple for each road containing # in order: the target, length, first and second velocity. adj = [[] for _ in range(n)] for _ in range(m): x, y, l, v1, v2 = (int(x) for x in input().split()) x -= 1 y -= 1 adj[x].append((y, l, v1, v2)) adj[y].append((x, l, v1, v2)) print(dijkstra(adj, 0, n - 1, t) * 1.0000009) if __name__ == "__main__": main()