#include<iostream>
#include<math.h>
using namespace std;
int main(void){
	int x,h;
	while(cin>>x>>h){
		double a,b,s;
		if(x==0 && h==0)break;
		a=x*x;
		b=(x*x/4)+(h*h);
		s=a+(sqrt(b)*x/2)*4;
		printf("%lf\n",s);
	}
	return 0;
}