#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
int main(void){
    double x,h,S,H;
    while(cin >> x >> h){
        if(x==0 && h==0)    break;
        else{
            H=sqrt(h*h+(x/2)*(x/2));
            S=x*x+x*(H/2)*4;
            std::cout << std::fixed << std::setprecision(6) << S << endl;
        }
    }
}
