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