文件目录

#include <bits/stdc++.h>
using namespace std;
double g[2005][2005];
int x, y, a, b, z, n, m;
double dis[2005];
bool vis[2005];
void dijk(int s)
{
    for (int i = 1; i <= n; i++)
        dis[i] = g[s][i];
    dis[s] = 1;
    vis[s] = 1;
    for (int i = 1; i < n; i++)
    {
        int k = 0;
        for (int j = 1; j <= n; j++)
            if (vis[j] == false && dis[j] > dis[k])
                k = j;
        vis[k] = 1;
        if (k == 0)
            break;
        for (int j = 1; j <= n; j++)
            if (vis[j] == false && dis[k] * g[k][j] > dis[j])
                dis[j] = dis[k] * g[k][j];
    }
}
int main()
{
    cin >> n >> m;
    while (m--)
    {
        cin >> x >> y >> z;
        g[x][y] = g[y][x] = (100 - z) / 100.0;
    }
    cin >> a >> b;
    dijk(a);
    printf("%.8lf", 100 / dis[b]);
    return 0;
}