#include #include #include #include using namespace std; const int maxn=10; int n; double h[maxn],b[maxn],a[maxn],he[maxn][maxn],height[maxn],res=9005; int p[maxn]; double get_height(double h1,double a1,double b1,double h2,double a2,double b2) { if(b1>=a2) return h2; if((a1-b1)/h1>=(a2-b2)/h2) { if(a1>=a2) return max(0.0,h2-(a2-b1)/(a1-b1)*h1); else return max(0.0,(a1-b2)/(a2-b2)*h2-h1); } if(b1>=b2) return (b1-b2)/(a2-b2)*h2; return 0; } double cal() { for(int i=0;i