#include <stdio.h>
#include <math.h>
int main()
{
	int x,h;
	float S;
	while(1){
		scanf("%d %d",&x,&h);
		if(x==0&&h==0)
			break;
		S=x*x;
		S+=x*sqrt(x*x/4.0+h*h*1.0)*2;
		printf("%f\n",S);
	}
	return 0;
}