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

int main() {
    cout << fixed << setprecision(6);

    long double x, h;
    while (true) {
        cin >> x >> h;
        if (x == 0 && h == 0) break;
        cout << x * x + 2 * x * sqrt(h * h + x * x / 4) << endl;
    }
}
