package no134; import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] x = new int[14]; int[] y = new int[14]; double[] w = new double[14]; x[0] = sc.nextInt(); y[0] = sc.nextInt(); int n = sc.nextInt(); for(int i=1;i<=n;i++) { x[i] = sc.nextInt(); y[i] = sc.nextInt(); w[i] = sc.nextDouble(); } n++; int[][] d = new int[n][n]; for(int i=0;i> i & 1) == 0) { t += w[i]; } } t = (t + 100) / 120; for(int i=0;i= 1E10) { continue; } for(int j=0;j> j & 1) == 1) { continue; } // System.out.println("(" + i + "," + Integer.toBinaryString(s) + ") -> (" + j + "," + Integer.toBinaryString(s | 1 << j) + ") : " + (dp[i][s] + d[i][j] * t)); dp[j][s | 1 << j] = Math.min(dp[j][s | 1 << j], dp[i][s] + (d[i][j] * t + w[j])); } } } System.out.println(dp[0][(1<