#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

int main(){
    cout << fixed << setprecision(10);
    while(true){
        double x,h;
        cin >> x >> h;
        if(x == 0 and h == 0) break;
        cout << 2*sqrt(h*h+(x*x)/4)*x + x*x << endl;
    }
    return 0;
}