I have implemented the code using the Dijkstra algorithm with Set

```
#include <bits/stdc++.h>
using namespace std;
typedef int64_t big;
typedef uint64_t ubig;
typedef long long ll;
typedef unsigned long long ull;
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define MOD 1000000007
#define PI 3.141592653589793
#define MAXN 1000000000+2
void fast(){ ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); }
vector<long double> dist;
void dij(int start, vector<pair<int, long double>> adj[]) {
set<pair<long double, int>> s;
s.insert({0.0, start});
while(!s.empty()) {
pair<long double, int> p = *(s.begin());
s.erase(s.begin());
for(auto child : adj[p.second]) {
if(dist[child.first] > dist[p.second] + child.second) {
if(dist[child.first] != 1e10) {
s.erase(s.find({dist[child.first], child.first}));
}
dist[child.first] = dist[p.second] + child.second;
s.insert({ dist[child.first], child.first });
}
}
}
}
int main() {
// your code goes here
fast();
int T;
cin>>T;
while(T--) {
int n, m, u, v, start, dest, len, sp;
cin>>n>>m>>start>>dest;
vector<pair<int, long double>>adj[n+1];
for(int i = 0;i<m;i++) {
cin>>u>>v>>len>>sp;
long double t = len / (sp*1.0);
adj[u].push_back(make_pair(v, t));
adj[v].push_back(make_pair(u, t));
}
dist = vector<long double>(n+1, 1e10);
cout.precision(8);
dist[start] = 0.0;
dij(start, adj);
if(dist[dest] == 1e10)
cout<<"-1\n";
else
cout<<fixed<<dist[dest]<<"\n";
}
return 0;
}
```