WA完了
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n,m;
const int N=2e3+7;
int fa[N],mp[N][N];
int tot;
struct Node{int h,ver,w;}e[N*N];
void add(int u,int v,int w){++tot;e[tot].h=u;e[tot].ver=v;e[tot].w=w;}
bool cmp(Node x,Node y){return x.w<y.w;}
int find(int x){return (fa[x]==x)?x:fa[x]=find(fa[x]);}
signed main(){
ios::sync_with_stdio(NULL);cin.tie(0);cout.tie(0);
cin>>n>>m;
for(int i=1;i<=n;i++)fa[i]=i;
for(int i=1;i<=m;i++){
int u,v,w;cin>>u>>v>>w;
add(u,v,w);add(u,v,w);
mp[u][v]=w;mp[v][u]=w;
}
int l,r;cin>>l>>r;
sort(e+1,e+tot+1,cmp);
int cnt=1,ans=0;
for(int i=1;i<cnt&&i<=tot;i++){
int u=e[i].h,v=e[i].ver,w=e[i].w;
if(find(u)==find(v))continue;
cnt++;mp[u][v]=min(mp[u][v],w);
}
cout<<fixed<<setprecision(8)<<100+100*(mp[l][r]*1.0/100);
return 0;
}