题目:
#include#include using namespace std;const double PI = acos(-1);double v[10005];int N, F;bool test(double x){ int tot = 0; for(int i=0; i = F;}int main (){ int T, r; scanf("%d", &T); while(T--) { scanf("%d%d", &N, &F); ++F; double lb = 0, ub = -1; for(int i=0; i ub) ub = v[i]; } ub += 1; while(lb + 1e-5< ub) { // [, ) double mid = (lb + ub) / 2; if(test(mid)) lb = mid; else ub = mid; } printf("%.4lf\n", lb); } return 0;}