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

int main()
{
	double x,h;
	while((x = readln.chomp.to!int) != 0 && (h = readln.chomp.to!int) != 0)
	{
		double sum = 0;
		sum += x*x;
		double half = x/2;
		sum += 2*x*sqrt(half*half+h*h);
		writefln("%.8f",sum);
	}
	return 0;
}