import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main_yukicoder298_1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); List> edges = new ArrayList>(); for (int i = 0; i < n; i++) { edges.add(new ArrayList()); } for (int i = 0; i < m; i++) { int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); edges.get(b).add(new Edge(a, b, c)); } int bit = 0, mask = 0; bit |= 0x1 << 0; mask |= 0x1 << 0; bit |= 0x1 << n - 1; mask |= 0x1 << n - 1; double ret = 0; for (int i = 0; i < 0x1 << n; i++) { if ((i & mask) != bit) { continue; } boolean[] yuki = new boolean[n]; for (int j = 0; j < n; j++) { if ((i & 0x1 << j) != 0) { yuki[j] = true; } } double tmp = 1.0; for (int j = 1; j < n; j++) { double tmp2 = 1.0; for (Edge from : edges.get(j)) { if (yuki[from.a]) { tmp2 *= (double)(100 - from.c) / 100; } } if (yuki[j]) { tmp *= 1.0 - tmp2; } else { tmp *= tmp2; } } ret += tmp; } System.out.printf("%.7f\n", ret); sc.close(); } private static class Edge { int a; // int b; int c; Edge(int a, int b, int c) { this.a = a; // this.b = b; this.c = c; } } }