Language: C++

#include <iostream>
#include <queue>
#include <cstring>
#include <cstdio>
using namespace std;

struct NODE{
	int from,to,speed;
	double cost;
	NODE(int from,int to,int speed,double cost) : from(from) , to(to) , speed(speed) , cost(cost) {
	}
};
bool operator < (const NODE &a,const NODE &b){
	return a.cost > b.cost;
}

vector< vector<NODE> > G;
bool done[32][32][80] = {};
int main(){
	int n,m;
	while(cin >> n >> m && n){
		memset(done,0,sizeof(done));
		int s,g;
		cin >> s >> g;
		s--,g--;
		G.clear();
		G.resize(n);
		for(int i = 0 ; i < m ; i++){
			int a,b,c,d;
			cin >> a >> b >> d >> c;
			a--,b--;	
			G[a].push_back(NODE(a,b,c,d));
			G[b].push_back(NODE(b,a,c,d));
			//cout << a << " " << b << " " << c << " " << d << endl;
		}
		priority_queue<NODE> Q;
		
		Q.push(NODE(n,s,0,0));
		while(Q.size()){
			NODE q = Q.top(); Q.pop();
			if( q.speed >= 80) continue;
			if( done[q.from][q.to][q.speed] ) continue;
			else done[q.from][q.to][q.speed] = true;
			if( q.to == g && q.speed == 1 ){
				printf("%.10lf\n",q.cost);
				goto exit;
			}
			for(int i = 0 ; i < G[q.to].size() ; i++){
				if( q.speed+0 > 0 && q.speed+0 <= G[q.to][i].speed && q.from != G[q.to][i].to ) Q.push(NODE(q.to,G[q.to][i].to,q.speed+0,q.cost+G[q.to][i].cost / (q.speed+0)));
				if( q.speed+1 > 0 && q.speed+1 <= G[q.to][i].speed && q.from != G[q.to][i].to ) Q.push(NODE(q.to,G[q.to][i].to,q.speed+1,q.cost+G[q.to][i].cost / (q.speed+1)));
				if( q.speed-1 > 0 && q.speed-1 <= G[q.to][i].speed && q.from != G[q.to][i].to ) Q.push(NODE(q.to,G[q.to][i].to,q.speed-1,q.cost+G[q.to][i].cost / (q.speed-1)));
			}
		}
		cout << "unreachable" << endl;
		exit:;
	}
}#include <iostream>
#include <queue>
#include <cstring>
#include <cstdio>
using namespace std;

struct NODE{
	int from,to,speed;
	double cost;
	NODE(int from,int to,int speed,double cost) : from(from) , to(to) , speed(speed) , cost(cost) {
	}
};
bool operator < (const NODE &a,const NODE &b){
	return a.cost > b.cost;
}

vector< vector<NODE> > G;
bool done[32][32][100] = {};
int main(){
	int n,m;
	while(cin >> n >> m && n){
		memset(done,0,sizeof(done));
		int s,g;
		cin >> s >> g;
		s--,g--;
		G.clear();
		G.resize(n);
		for(int i = 0 ; i < m ; i++){
			int a,b,c,d;
			cin >> a >> b >> d >> c;
			a--,b--;	
			G[a].push_back(NODE(a,b,c,d));
			G[b].push_back(NODE(b,a,c,d));
			//cout << a << " " << b << " " << c << " " << d << endl;
		}
		priority_queue<NODE> Q;
		
		Q.push(NODE(n,s,0,0));
		while(Q.size()){
			NODE q = Q.top(); Q.pop();
			if( q.speed >= 100) continue;
			if( done[q.from][q.to][q.speed] ) continue;
			else done[q.from][q.to][q.speed] = true;
			if( q.to == g && q.speed == 1 ){
				printf("%.10lf\n",q.cost);
				goto exit;
			}
			for(int i = 0 ; i < G[q.to].size() ; i++){
				if( q.speed+0 > 0 && q.speed+0 <= G[q.to][i].speed && q.from != G[q.to][i].to ) Q.push(NODE(q.to,G[q.to][i].to,q.speed+0,q.cost+G[q.to][i].cost / (q.speed+0)));
				if( q.speed+1 > 0 && q.speed+1 <= G[q.to][i].speed && q.from != G[q.to][i].to ) Q.push(NODE(q.to,G[q.to][i].to,q.speed+1,q.cost+G[q.to][i].cost / (q.speed+1)));
				if( q.speed-1 > 0 && q.speed-1 <= G[q.to][i].speed && q.from != G[q.to][i].to ) Q.push(NODE(q.to,G[q.to][i].to,q.speed-1,q.cost+G[q.to][i].cost / (q.speed-1)));
			}
		}
		cout << "unreachable" << endl;
		exit:;
	}
}

Compiler output:
a.cc:57:2: error: stray '#' in program
   57 | }#include <iostream>
      |  ^
a.cc:57:3: error: 'include' does not name a type
   57 | }#include <iostream>
      |   ^~~~~~~
a.cc:63:8: error: redefinition of 'struct NODE'
   63 | struct NODE{
      |        ^~~~
a.cc:7:8: note: previous definition of 'struct NODE'
    7 | struct NODE{
      |        ^~~~
a.cc:69:6: error: redefinition of 'bool operator<(const NODE&, const NODE&)'
   69 | bool operator < (const NODE &a,const NODE &b){
      |      ^~~~~~~~
a.cc:13:6: note: 'bool operator<(const NODE&, const NODE&)' previously defined here
   13 | bool operator < (const NODE &a,const NODE &b){
      |      ^~~~~~~~
a.cc:73:24: error: redefinition of 'std::vector<std::vector<NODE> > G'
   73 | vector< vector<NODE> > G;
      |                        ^
a.cc:17:24: note: 'std::vector<std::vector<NODE> > G' previously declared here
   17 | vector< vector<NODE> > G;
      |                        ^
a.cc:74:6: error: conflicting declaration 'bool done [32][32][100]'
   74 | bool done[32][32][100] = {};
      |      ^~~~
a.cc:18:6: note: previous declaration as 'bool done [32][32][80]'
   18 | bool done[32][32][80] = {};
      |      ^~~~
a.cc:75:5: error: redefinition of 'int main()'
   75 | int main(){
      |     ^~~~
a.cc:19:5: note: 'int main()' previously defined here
   19 | int main(){
      |     ^~~~