#include <stdio.h>

double get_noise(double L) {
    return L * 0.1;
}

int main() {
    double k = 50.0;
    double high,low;
    low = 1.0;
    high = 1000.0;
    for(int i = 0; i < 100; i++){
        double mid = (high + low) / 2.0;

        if (get_noise(mid) <= k) {
            low = mid ;
        }else{
            high = mid;
        }
    }
    printf("%.3f ", low);
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: