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

using namespace std;

int main()
{
    double x, h;
    cout << setprecision(6) << setiosflags(ios::fixed);
    while (cin >> x >> h, x || h) {
        cout << (x * x + 2 * sqrt(h * h + x * x / 4) * x) << endl;
    }

    return 0;
}