#include #include #include #include #include using namespace std; #define REP(i, n) for (int i=0; i pubs; int k, K; int D[22][22]; // TSP int tsp[2222222][22]; // Nejkratší z jedné hospody do všech ostatních void bfs(Pt start) { REP(i, h) REP(j, w) dst[i][j] = -1; queue q; q.push(start); dst[start.y][start.x] = 0; while (!q.empty()) { Pt p = q.front(); q.pop(); REP(d, 4) { Pt t = Pt(p.y+dy[d], p.x+dx[d]); if (t.x>=0 && t.x=0 && t.y