#include <bits/stdc++.h>

using namespace std;

int main() {
    int x, h;
    while (scanf("%d%d", &x, &h), (x || h)) {
        double S = x * sqrt(x * x + 4 * h * h) + x * x;
        printf("%.10f\n", S);
    }

    return 0;
}
