# coding: utf-8 # Here your code ! # -*- coding: utf-8 -*- """ Created on Sun Sep 25 16:13:19 2016 @author: dotha """ def red(ll): j = 1 for l in ll: j *= (1-l) return 1 - j def counter(to): if to == 0: return 1 else: return red([counter(t[0])*t[2]*0.01 for t in table if t[1]==to]) if __name__ == '__main__': N,M = input().split() N=int(N) M=int(M) table=[list(map(int,input().split())) for i in range(M)] print(red([counter(t[0])*t[2]*0.01 for t in table if t[1]==N-1]))