#include<bits/stdc++.h>
using namespace std;

int main(){
	double x,h;
	while(1){
	cin>>x>>h;
	if(x==0)break;
	double s=0.0;
	s+=x*x;
	s+=2*x*sqrt(x*x/4+h*h);
	printf("%0.8lf\n",s);
	}

	return 0;
}

