#include #include #include #include #include using namespace std; #define N 510 struct node{ int nt; int cost; int x1,x2,y1,y2; }s[N]; vector g[N]; int linker[N]; bool vis[N]; bool dfs(int u){ for(int i=0;i