#include <bits/stdc++.h>
using namespace std;
int main(void){
    double x,h;
    while (cin>>x>>h) {
        if (x==0&&h==0) {
            break;
        } else {
            double S=0.0;
            S=S+x*x;
            double H=sqrt(h*h+(x/2)*(x/2));
            S=S+(x*H/2)*4;
            printf("%.6f",S);
            cout<<endl;
        }
    }
}

