#include #include using namespace std; class range {private: struct I{int x;int operator*(){return x;}bool operator!=(I& lhs){return x ps; vector> dp; double calc_speed(int mask) { double weight = 0; for(int i : range(n)) { // 荷物がある = ビットが立っている if(mask>>i & 1) { weight += ps[i].w; } } return 120. / (weight + 100); } int dist(point p, point q) { return abs(p.x - q.x) + abs(p.y - q.y); } double rec(int mask, int v) { double &res = dp[v][mask]; if(res != -1) { return res; } double speed = calc_speed(mask); // v番目から酒屋に帰る if(mask == 1) { return res = dist(ps[v], ps[0]) / speed; } res = inf; // v番目からi番目の配達先に行って荷物を降ろす for(int i : range(1, n)) { if(!(mask>>i & 1)) { continue; } int nmask = mask & ~(1<(1<