import java.util.*;
import java.io.*;
import java.math.*;

public class jeroen
{
	public static void main(String[] args) throws Exception
	{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String[] line = in.readLine().split(" ");
		int n = Integer.valueOf(line[0]);
		int m = Integer.valueOf(line[1]);
		int t = Integer.valueOf(line[2]);
		Edge[] es = new Edge[m];
		for(int i = 0; i < m; i++)
			es[i] = new Edge(in.readLine());

		LinkedList<Edge>[] nbs = new LinkedList[n];
		for(int i = 0; i < n; i++)
			nbs[i] = new LinkedList<Edge>();
		for(int i = 0; i < m; i++) {
			nbs[es[i].x-1].add(es[i]);
			nbs[es[i].y-1].add(es[i]);
		}

		PriorityQueue<State> q = new PriorityQueue<State>();
		q.offer(new State(1, 0));
		boolean[] seen = new boolean[n];
		while(!q.isEmpty()) {
			State top = q.poll();
			if(seen[top.x-1]) continue;
			seen[top.x-1] = true;
			if(top.x == n) {
				System.out.println(top.t);
				return;
			}
			for(Edge ed : nbs[top.x-1]) {
				int y = ed.x == top.x ? ed.y : ed.x;
				State ns = new State(y, arrival(t, top.t, ed.l, ed.v, ed.w));
				q.offer(ns);
			}
		}
		throw new Exception("Target not reached");
	}

	static double arrival(double ct, double t, double l, double v, double w) {
		if(t >= ct) return t + (l / w);
		double vt = l / v;
		if(t + vt < ct) return t + vt;
		double p1 = v * (ct - t);
		return ct + ((l - p1) / w);
	}

	static class Edge {
		public int x, y, l, v, w;

		public Edge(String s) {
			String[] line = s.split(" ");
			this.x = Integer.valueOf(line[0]);
			this.y = Integer.valueOf(line[1]);
			this.l = Integer.valueOf(line[2]);
			this.v = Integer.valueOf(line[3]);
			this.w = Integer.valueOf(line[4]);
		}
	}

	static class State implements Comparable<State> {
		public int x;
		public double t;

		public State(int x, double t) {
			this.x = x;
			this.t = t;
		}

		public int compareTo(State other) {
			return Double.compare(t, other.t);
		}
	}
}
