Language: C++

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <stdio.h>
#include <complex>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef vector<LL> VLL;

//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define MT(a,b,c) MP(a, MP(b, c))

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

int n,m,s,g;
map<int, vector<TIII> > r;
map<TIII, double> v;

int main(){
	while(1){
		double ret = -1.0;
		cin>>n>>m;
		if(n==0&&m==0)return 0;
		cin>>s>>g;
		r.clear();
		v.clear();
		REP(i,m){
			int x,y,d,c;
			cin>>x>>y>>d>>c;
			r[x].PB(MT(y,d,c));
			r[y].PB(MT(x,d,c));
		}
		priority_queue<pair<double, TIII > , vector<pair<double, TIII > >, greater<pair<double, TIII > > > q;
		q.push(MP(0.0,MP(s, 0)));
		while(!q.empty()){
			pair<double, TIII > tmp = q.top();
			q.pop();
			if(EXIST(v, tmp.second))continue;
			if(tmp.second.first == g && tmp.second.second.second == 1){
				ret = tmp.first;
				break;
			}
			v[tmp.second]=tmp.first;
			int city = tmp.second.first;
			int speed = tmp.second.second.second;
			int pre = tmp.second.second.first;
			double now = tmp.first;
			REP(i, r[city].size()){
				FOR(sp, speed-1, speed+2){
					if(sp<1)continue;
					TIII f = r[city][i];
					if(f.second.second >= sp && sp > 0 && f.first != pre)q.push(MP(now+(f.second.first*1.0)/(sp*1.0), MP(f.first, sp)));
					
				}
			}
		}
		if(ret < 0.0)cout << "unreachable" <<endl;
		else printf("%.6f\n", ret);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:81:23: error: no matching function for call to 'std::priority_queue<std::pair<double, std::pair<int, std::pair<int, int> > >, std::vector<std::pair<double, std::pair<int, std::pair<int, int> > > >, std::greater<std::pair<double, std::pair<int, std::pair<int, int> > > > >::push(std::pair<double, std::pair<int, int> >)'
   81 |                 q.push(MP(0.0,MP(s, 0)));
      |                 ~~~~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:13:
/usr/include/c++/14/bits/stl_queue.h:736:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = std::pair<double, std::pair<int, std::pair<int, int> > >; _Sequence = std::vector<std::pair<double, std::pair<int, std::pair<int, int> > > >; _Compare = std::greater<std::pair<double, std::pair<int, std::pair<int, int> > > >; value_type = std::pair<double, std::pair<int, std::pair<int, int> > >]'
  736 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:736:30: note:   no known conversion for argument 1 from 'std::pair<double, std::pair<int, int> >' to 'const std::priority_queue<std::pair<double, std::pair<int, std::pair<int, int> > >, std::vector<std::pair<double, std::pair<int, std::pair<int, int> > > >, std::greater<std::pair<double, std::pair<int, std::pair<int, int> > > > >::value_type&' {aka 'const std::pair<double, std::pair<int, std::pair<int, int> > >&'}
  736 |       push(const value_type& __x)
      |            ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_queue.h:744:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(value_type&&) [with _Tp = std::pair<double, std::pair<int, std::pair<int, int> > >; _Sequence = std::vector<std::pair<double, std::pair<int, std::pair<int, int> > > >; _Compare = std::greater<std::pair<double, std::pair<int, std::pair<int, int> > > >; value_type = std::pair<double, std::pair<int, std::pair<int, int> > >]'
  744 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:744:25: note:   no known conversion for argument 1 from 'std::pair<double, std::pair<int, int> >' to 'std::priority_queue<std::pair<double, std::pair<int, std::pair<int, int> > >, std::vector<std::pair<double, std::pair<int, std::pair<int, int> > > >, std::greater<std::pair<double, std::pair<int, std::pair<int, int> > > > >::value_type&&' {aka 'std::pair<double, std::pair<int, std::pair<int, int> > >&&'}
  744 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~
a.cc:99:100: error: no matching function for call to 'std::priority_queue<std::pair<double, std::pair<int, std::pair<int, int> > >, std::vector<std::pair<double, std::pair<int, std::pair<int, int> > > >, std::greater<std::pair<double, std::pair<int, std::pair<int, int> > > > >::push(std::pair<double, std::pair<int, int> >)'
   99 |                                         if(f.second.second >= sp && sp > 0 && f.first != pre)q.push(MP(now+(f.second.first*1.0)/(sp*1.0), MP(f.first, sp)));
      |                                                                                              ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:736:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(const value_type&) [with _Tp = std::pair<double, std::pair<int, std::pair<int, int> > >; _Sequence = std::vector<std::pair<double, std::pair<int, std::pair<int, int> > > >; _Compare = std::greater<std::pair<double, std::pair<int, std::pair<int, int> > > >; value_type = std::pair<double, std::pair<int, std::pair<int, int> > >]'
  736 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:736:30: note:   no known conversion for argument 1 from 'std::pair<double, std::pair<int, int> >' to 'const std::priority_queue<std::pair<double, std::pair<int, std::pair<int, int> > >, std::vector<std::pair<double, std::pair<int, std::pair<int, int> > > >, std::greater<std::pair<double, std::pair<int, std::pair<int, int> > > > >::value_type&' {aka 'const std::pair<double, std::pair<int, std::pair<int, int> > >&'}
  736 |       push(const value_type& __x)
      |            ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_queue.h:744:7: note: candidate: 'void std::priority_queue<_Tp, _Sequence, _Compare>::push(value_type&&) [with _Tp = std::pair<double, std::pair<int, std::pair<int, int> > >; _Sequence = std::vector<std::pair<double, std::pair<int, std::pair<int, int> > > >; _Compare = std::greater<std::pair<double, std::pair<int, std::pair<int, int> > > >; value_type = std::pair<double, std::pair<int, std::pair<int, int> > >]'
  744 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:744:25: note:   no known conversion for argument 1 from 'std::pair<double, std::pair<int, int> >' to 'std::priority_queue<std::pair<double, std::pair<int, std::pair<int, int> > >, std::vector<std::pair<double, std::pair<int, std::pair<int, int> > > >, std::greater<std::pair<double, std::pair<int, std::pair<int, int> > > > >::value_type&&' {aka 'std::pair<double, std::pair<int, std::pair<int, int> > >&&'}
  744 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~