#include<stdio.h>
#include<math.h>

int main(){
	
	int x,h,y,num[200]={0},i,con=0;
	
		for(i=0;;i++){
	scanf("%d %d",&x,&h);
	
			y=sqrt((double)(x*x/4+h*h));
			num[i]=(double)(x*x+2*x*y);
			con=con+1;
	if((x==0)&&(h==0)){
			con=con-1;
			break;
		
	}
		
		}
	
		
	
	for(i=0;i<con;i++)printf("%f\n",(double)(num[i]));
	return 0;
}
	