ll@t; rep(t){ ll@n; double@x,@h[n],@a[n]; double z=1e99; rep(i,n){ double w=0,p=0; rep(j,i){ if(a[i]>=a[j]){ break_continue; } double r=a[i]/a[j]; double t=r/sqrt(1-r*r); p+=t*h[j]; w+=hypot(t,1)*h[j]*a[j]; } if(x/2-p<0) continue; w+=(x/2-p)*a[i]; z