#include<iostream>
#include<cstdio>
#include<string>
#include<math.h>

using namespace std;

int main()
{	
	double x,h;
	double ans,height;
	while(cin>>x>>h,x!=0){
		height=sqrt(h*h+x*x/4);
		ans=0;
		ans+=x*x+height*x*2;
		printf("%.6lf",ans);
	}
	return 0;
}