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

void main()
{
    for(;;)
    {
        immutable real x = readln().chomp().to!real();
        immutable real h = readln().chomp().to!real();
        if(x==0 && h==0) break;
        writefln("%.6f",x*x+x*sqrt(x*x+4*h*h));
    }
}