Language: C++

#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
const int INFINITY_HAHA = 999999;

typedef struct edge
{
    int to, limit;
    double dist;
    edge(int x, double y, int z): to(x), dist(y), limit(z) {}
} Edge;


typedef struct status {
    int from, now, speed;
    double time;
    status(int x, int x2, double y, int z): from(x), now(x2), time(y), speed(z) {}
    bool operator< (const status &b) const {
        return time > b.time;
    }
} Status;



int main() {
    freopen("input.txt", "r", stdin);
 
    int ncities, nroads;
    double d[35][35][35];

    while(scanf("%d%d", &ncities, &nroads) != EOF && !(ncities == 0 && nroads == 0)) {

        // Input
        int start_index, end_index;
        scanf("%d%d" , &start_index, &end_index);

        vector<Edge> paths[100]; // Array of vector
        for(int n = 0; n < nroads; ++n) {
            int x, y, d, c;
            scanf("%d%d%d%d", &x, &y, &d, &c);
            paths[x].push_back(Edge(y, d, c));
            paths[y].push_back(Edge(x, d, c));
        }

        for(int i = 0; i < 35; ++i) {
            for(int j = 0; j < 35; ++j) {
                for(int k = 0; k < 35; ++k) {
                    d[i][j][k]= INFINITY_HAHA;
                }
            }
        }

        double minimun_v = 0;
        priority_queue< Status> Q;
        for(int i = 0; i < paths[start_index].size(); ++i) {
            Edge e = paths[start_index][i];
            Q.push(Status(start_index, e.to, e.dist, 1));
            d[start_index][e.to][1] = e.dist;
        }

        while(!Q.empty()) {
            Status cs = Q.top();
            Q.pop();
 
            if(d[cs.from][cs.now][cs.speed] < cs.time) continue;

            if(cs.now == end_index && cs.speed == 1) {
                minimun_v = cs.time;
                break;
            }

            for(int j = 0; j < paths[cs.now].size(); ++j) {
                Edge s = paths[cs.now][j];
                if(s.to == cs.from) continue;

                for(int z = -1; z <= 1;#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
const int INFINITY_HAHA = 999999;

typedef struct edge
{
    int to, limit;
    double dist;
    edge(int x, double y, int z): to(x), dist(y), limit(z) {}
} Edge;


typedef struct status {
    int from, now, speed;
    double time;
    status(int x, int x2, double y, int z): from(x), now(x2), time(y), speed(z) {}
    bool operator< (const status &b) const {
        return time > b.time;
    }
} Status;



int main() {
    //freopen("input.txt", "r", stdin);
 
    int ncities, nroads;
    double d[35][35][35];

    while(scanf("%d%d", &ncities, &nroads) != EOF && !(ncities == 0 && nroads == 0)) {

        // Input
        int start_index, end_index;
        scanf("%d%d" , &start_index, &end_index);

        vector<Edge> paths[100]; // Array of vector
        for(int n = 0; n < nroads; ++n) {
            int x, y, d, c;
            scanf("%d%d%d%d", &x, &y, &d, &c);
            paths[x].push_back(Edge(y, d, c));
            paths[y].push_back(Edge(x, d, c));
        }

        for(int i = 0; i < 35; ++i) {
            for(int j = 0; j < 35; ++j) {
                for(int k = 0; k < 35; ++k) {
                    d[i][j][k]= INFINITY_HAHA;
                }
            }
        }

        double minimun_v = 0;
        priority_queue< Status> Q;
        for(int i = 0; i < paths[start_index].size(); ++i) {
            Edge e = paths[start_index][i];
            Q.push(Status(start_index, e.to, e.dist, 1));
            d[start_index][e.to][1] = e.dist;
        }

        while(!Q.empty()) {
            Status cs = Q.top();
            Q.pop();
 
            if(d[cs.from][cs.now][cs.speed] < cs.time) continue;

            if(cs.now == end_index && cs.speed == 1) {
                minimun_v = cs.time;
                break;
            }

            for(int j = 0; j < paths[cs.now].size(); ++j) {
                Edge s = paths[cs.now][j];
                if(s.to == cs.from) continue;

                for(int z = -1; z <= 1; ++z) {
                    if(cs.speed + z > 0 && cs.speed + z <= s.limit) {
                        double newdist = cs.time + s.dist/((double)(cs.speed + z));
                        if(newdist < d[cs.now][s.to][cs.speed + z]) {
                            d[cs.now][s.to][cs.speed + z] = newdist;
                            Q.push(Status(cs.now, s.to, newdist, cs.speed + z));
                        }
                    }
                }
            }
        }
 
        if(minimun_v) {
            printf("%0.5lf\n", minimun_v);
        } else {
            printf("unreachable\n");
        }
    }
 
    return 0;
}
 ++z) {
                    if(cs.speed + z > 0 && cs.speed + z <= s.limit) {
                        double newdist = cs.time + s.dist/((double)(cs.speed + z));
                        if(newdist < d[cs.now][s.to][cs.speed + z]) {
                            d[cs.now][s.to][cs.speed + z] = newdist;
                            Q.push(Status(cs.now, s.to, newdist, cs.speed + z));
                        }
                    }
                }
            }
        }
 
        if(minimun_v) {
            printf("%0.5lf\n", minimun_v);
        } else {
            printf("unreachable\n");
        }
    }
 
    return 0;
}

Compiler output:
a.cc:79:40: error: stray '#' in program
   79 |                 for(int z = -1; z <= 1;#include <cstdio>
      |                                        ^
a.cc: In function 'int main()':
a.cc:79:41: error: 'include' was not declared in this scope
   79 |                 for(int z = -1; z <= 1;#include <cstdio>
      |                                         ^~~~~~~
a.cc:79:50: error: 'cstdio' was not declared in this scope; did you mean 'stdin'?
   79 |                 for(int z = -1; z <= 1;#include <cstdio>
      |                                                  ^~~~~~
      |                                                  stdin
a.cc:84:1: error: expected primary-expression before 'using'
   84 | using namespace std;
      | ^~~~~
a.cc:79:57: error: expected ')' before 'using'
   79 |                 for(int z = -1; z <= 1;#include <cstdio>
      |                    ~                                    ^
      |                                                         )
......
   84 | using namespace std;
      | ~~~~~                                                    
a.cc:106:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
  106 | int main() {
      |         ^~
a.cc:106:9: note: remove parentheses to default-initialize a variable
  106 | int main() {
      |         ^~
      |         --
a.cc:106:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:106:12: error: a function-definition is not allowed here before '{' token
  106 | int main() {
      |            ^
a.cc:178:4: error: 'z' was not declared in this scope
  178 |  ++z) {
      |    ^