http://codeforces.com/problemset/problem/1199/B添加链接描述
思路:
x
+
H
=
y
,
x
2
+
L
2
=
y
2
x+H=y,x^{2}+L^{2}=y^{2}
x+H=y,x2+L2=y2。
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
double l,h;
int main()
{
scanf("%lf%lf",&h,&l);
printf("%.8f\n",(l*l-h*h)/(2*h));
return 0;
}