#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,a,b) for(int i=a;i<(int)b;i++) #define rep(i,n) REP(i,0,n) #define all(c) (c).begin(), (c).end() #define zero(a) memset(a, 0, sizeof a) #define minus(a) memset(a, -1, sizeof a) #define minimize(a, x) a = std::min(a, x) #define maximize(a, x) a = std::max(a, x) using ll = long long; int const inf = 1<<29; int N, M; double G[22][22]; int main() { minus(G); cin >> N >> M; rep(i, M) { int a, b; double c; cin >> a >> b >> c; c /= 100; G[a][b] = c; } double ans = 0.0; // N-1がyukicoderについて話す確率 rep(S, 1< use(S); if(!use[0] || !use[N-1]) { continue; } // 起点と終点は必ず話す double PForS = 1.0; // 話すグループが集合Sであるときの確率(初期条件はグループ0が話す確率と考える) REP(y, 1, N) { // グループ0は絶対話す double PForYNotTaking = 1.0; // グループyの話さない確率 rep(x, N) { if(use[x] && G[x][y] >= 0) { PForYNotTaking *= 1.0 - G[x][y]; // xは話していたが、yに伝わらなかった } } // printf("%.10f\n", PForYNotTaking); // PForS[S] = Π_{y in S} PForXTaking[x] if(!use[y]) { PForS *= PForYNotTaking; } else { PForS *= 1.0 - PForYNotTaking; // PForXTaking[y] = 1.0 - PForXNotTaking[y] } // printf("%.10f\n", PForS); } ans += PForS; // puts(""); } printf("%.15f\n", ans); return 0; }