int n, m, x[14], y[14], p, q; double w[13], dp[1 << 13][13], ww[1 << 13]; double dist(int i, int j) { return abs(x[i] - x[j]) + abs(y[i] - y[j]); } double calc(int i, int j, double weight) { return (weight + 100.0) / 120.0 * dist(i, j); } { rd(p, q, n, (x, y, w)(n)); x[n] = p; y[n] = q; m = 1 << n; rep(i, m) rep(j, n) dp[i][j] = ll_inf; rep(v, n) dp[m - 1][v] = dist(v, n) * 5.0 / 6; rrep(s, m - 1) rep(v, n) rep(u, n) { if (!(s & 1 << u)) { ww[s] = ww[s | 1 << u] + w[u]; dp[s][v]