#include using namespace std; #define ll long long const int N = 205, M = 405; int T, n, cnt, xl[N], xr[N], yl[N], yr[N], x[M], y[M]; double dis[M][M]; bool vis[M][M]; priority_queue, vector >, greater > > q; void work(int a, int b, int c, int d){ int k=0; for(int i=1; i<=n; ++i) k+=(xl[i]<=x[a] && x[a]<=xr[i] && yl[i]<=y[b] && y[b]<=yr[i] && xl[i]<=x[c] && x[c]<=xr[i] && yl[i]<=y[d] && y[d]<=yr[i]); double ti=abs(x[a]-x[c]+y[b]-y[d])/(k+1.); if(dis[a][b]+ti u=q.top(); q.pop(); int xx=u.second/(cnt+1), yy=u.second%(cnt+1); if(vis[xx][yy]) continue; vis[xx][yy]=1; if(x[xx]==xr[0] && y[yy]==yr[0]){ printf("%.5lf\n", dis[xx][yy]); while(!q.empty()) q.pop(); break; } if(xx>1) work(xx, yy, xx-1, yy); if(xx1) work(xx, yy, xx, yy-1); if(yy