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