#include #include #include #include #include #include int main() { /* input */ int N, M; int X, Y; int p[200000], q[200000]; int maxp = 0, maxq = 0; int P[200000], Q[100000]; scanf( " %d %d", &N, &M ); scanf( " %d %d", &X, &Y ); std::vector> list_lines(N); for ( int i=0; i q_graph; q_graph.push(X); cost[X-1] = 0; int current, next; double distance; while ( not q_graph.empty() ) { current = q_graph.front(); q_graph.pop(); for ( int i=0; i cost[current-1] + distance ) { cost[next-1] = cost[current-1] + distance; q_graph.push(next); } if ( next == Y ) break; } } /* output */ printf( "%.8lf\n", cost[Y-1] ); return 0; }