#include using namespace std; typedef long double ld; // Place the computers from right to left. // - start at position 0 // - move right until we hit something // - if that something's the destination, stop // - if that something's another computer: // - we'll need to move that computer as well // - check whether it's worth it // - if so, continue // - otherwise, stop there. ld solve(vector x){ int const n=x.size(); vector s(n+1); for (int i=0; i cx(n+1,1e60L); for (int i=n; i--;){ cx[i]=min(cx[i+1],(ld)x[i]); for (int j=i+1; j<=n; j++) if (j=cx[j] and (s[j+1]-s[i])/(1+j-i)>=cx[j]) cx[i]=min(cx[j+1], (s[j+1]-s[i])/(j+1-i)); else break; for (int j=i+1; j>n; vector x(n),y(n); for (int i=0; i>x[i]>>y[i]; cout.precision(6); cout<