#include <iostream>
#include <cmath>

using namespace std;

int main() {
    double x, h;
    while (cin >> x >> h && x != 0) {
        cout << x*x + 2*x*sqrt(x*x/4 + h*h) << endl;
    }

    return 0;
}