import std.stdio;
import std.algorithm;
import std.string;
import std.conv;
import std.math;

void main(){

    real x,h;
    while(true){
	x = to!real(chomp(readln()));
	h = to!real(chomp(readln()));
	if(x==0&&h==0) break;
	real h1 = sqrt(x*x/4 + h*h);
	real ans = x*x + 2 * h1 * x;
	writef("%.5f\n",ans);
    }
}