#include<iostream>
#include<stdio.h>
#include<cmath>
using namespace std;
int main(){
	double x,h;

while(1){
	cin>>x;
	cin>>h;


	if(x==0&&h==0){
	break;
	}

	printf("%f\n",x*x+2*x*sqrt(h*h+x*x/4));
}
	return 0;
}
