答案

ljy123456 爱因斯坦 2022-05-29 15:31:27 3

#include <stdio.h> #include #include #include <string.h> #include #include <math.h> #include #include #include #include #include using namespace std; typedef long long LL; #define MAX 100001

int a[MAX]; int b[MAX];

int main() { double L_before; double L_After; double rig, lef, mid; double n, c; scanf("%lf%lf%lf", &L_before, &n, &c); if(L_before < 1e-14){ printf("0.000\n"); return 0; }

L_After = L_before * (1 + n * c);

lef = 0.0; 
rig = asin(1.0); 

while(rig - lef>1e-14){ mid = (rig + lef) / 2; if(L_After * sin(mid) / mid <= L_before){

        rig = mid;
    }else {
        lef = mid;
    }
}

printf("%.3lf\n", L_before / 2 * tan(lef / 2));

return 0;

}

{{ vote && vote.total.up }}