#include "bits/stdc++.h" using namespace std; #define REP(i, n) for(int i=0; i<(n); i++) struct P { int x, y; P(){}; P(int _x, int _y): x(_x), y(_y){}; }; int N,M,A,B,C; map > MAP; double dfs(int n) { if (n == 0) return 1.0; double fail = 1.0; for (auto&& p: MAP[n]) { fail *= 1.0 - dfs(p.x) * p.y / 100.0; } return 1 - fail; } signed main() { cin >> N >> M; vector Q(N, 0.0); Q[0] = 1.0; REP(i,M) { cin >> A >> B >> C; P p = P(A, C); MAP[B].push_back(p); } printf("%.14f\n", dfs(N-1)); return 0; }