#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

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

