https://www.acmicpc.net/problem/2022
#include<stdio.h>
#include<string.h>
#include <math.h>
static double f(double x,double k,double a){
return -(a*x/k)+a;
}
int main() {
double x,y,c;
scanf("%lf %lf %lf",&x,&y,&c);
double l=0;
double r=x<y?x:y;
for(int i=0;i<100;i++){
double k=(r+l)/2;
double a=sqrt(x*x-k*k);
double b=sqrt(y*y-k*k);
double c0=k*c/b;
if(f(c0,k,a)>c) l=k;
else r=k;
}
printf("%.3lf",l);
}