import std.stdio;
import std.c.stdio;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.regex;
import std.typecons;

const INF = 1e10;

struct Edge {
    int from, to;
    double cost;
    int limit;
}
 
void main() {
    int N, M;
    int S, G;
    Edge[][] Graph;

    bool input() {
        scanf("%d %d\n", &N, &M);
        if (N == 0 && M == 0) return false;
        scanf("%d %d\n", &S, &G);
        Graph = new Edge[][N + 1];
        foreach (i; 0 .. M) {
            int x, y, d, c;
            scanf("%d %d %d %d\n", &x, &y, &d, &c);
            Graph[x] ~= Edge(x, y, d, c);
            Graph[y] ~= Edge(y, x, d, c);
        }
        return true;
    }

    void solve() {
        auto D = new double[][][](N + 1, 31, 31);
        foreach (i; 0 .. N + 1) foreach (j; 0 .. 31) D[i][j][] = INF;
        struct P {
            int prev, v, city;
            double cost;
        }
        BinaryHeap!(Array!P, "a.cost > b.cost") PQ;
        PQ.insert(P(0, 0, S, 0));
        D[0][0][S] = 0;
        while (!PQ.empty) {
            P cur = PQ.front; PQ.removeFront;
            foreach (edge; Graph[cur.city]) {
                for (int d = -1; d <= 1; d++) {
                    int v = cur.v + d;
                    if (v <= 0 || v > edge.limit) continue;
                    if (edge.to == cur.prev) continue;
                    auto next = P(cur.city, v, edge.to, cur.cost + edge.cost / v);
                    if (D[next.prev][next.v][next.city] > next.cost) {
                        D[next.prev][next.v][next.city] = next.cost;
                        PQ.insert(next);
                    }
                }
            }
        }
        double Ans = INF;
        foreach (i; 0 .. N + 1) {
            Ans = min(Ans, D[i][1][G]);
        }
        if (Ans == INF) {
            writeln("unreachable");
        } else {
            writefln("%.10f", Ans);
        }
    }

    while (input) solve;
}