#include<cstdio>
#include<cmath>
using namespace std;
int main(void)
{
	double x,h,y,s;
	while(1)	{
		scanf("%lf %lf",&x,&h);
		if(x==0.0 && h==0.0)	break;
		y=sqrt((x/2.0)*(x/2.0)+h*h);
		s=x*x+4.0*(x*y/2.0);
		printf("%lf\n",s);
	}
	return 0;
}
