def read_data(): N, M = map(int, input().split()) Cs = [dict() for i in range(N)] for m in range(M): src, dst, c = map(int, input().split()) Cs[dst][src] = c/100 return N, M, Cs def solve(N, M, Cs): global ps, cs cs = Cs ps = [-1] * N ps[0] = 1 return dfs(N-1) def dfs(dst): global ps, cs if ps[dst] != -1: return ps[dst] tmp = 1 for src, c in cs[dst].items(): tmp *= (1 - dfs(src)*c) prob = 1 - tmp ps[dst] = prob return prob N, M, Cs = read_data() print(solve(N, M, Cs))