#include <bits/stdc++.h>

using namespace std;

typedef pair<double,double> PII;

typedef double ld;

const int N = 350010;

int n,m,idx,A,B,t;
ld V,w[N];
int e[N],ne[N],h[N],cnt[N];
ld d[N];
bool str[N];

void add(int a,int b,ld c)
{
	e[idx]=b,w[idx]=c,ne[idx]=h[a],h[a]=idx++;
}


int spfa()
{
   for(int i=0;i<=n;i++) d[i]=1e16;
 
    queue<int>q;
    d[A]=V;
    q.push(A);
 
    while(q.size())
    {
        auto t=q.front();
        q.pop();
 
        str[t]=false;
 
        for(int i=h[t];i!=-1;i=ne[i])
        {
            int j=e[i];
            if(d[j]>d[t]*w[i])
            {
                d[j]=d[t]*w[i];
 				cnt[j]=cnt[t]+1;
 				if(cnt[j]>=n) return false;
                if(!str[j])
                {
                    q.push(j);
                    str[j]=true;
                }
            }
        }
    }
    return true;
}

int main()
{
	cin>>n>>m>>V>>A>>B;
	memset(h,-1,sizeof h);
	
	while(m--)
	{
		int a,b;
		ld c;
		cin>>a>>b>>c;
		add(a,b,c);
	}
	bool t=spfa();
    
	if(!t) cout<<"0\n";
    else printf("%.2lf\n",d[B]);
        
	return 0;
}