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

int main()
{	
	double x, h;

	cin >> x >> h;

	while (x > 0 || h > 0) {
		cout << fixed << setprecision(6)
			<< x * x + 2 * x * sqrt(x * x / 4 + h * h) << endl;

		cin >> x >> h;
	}

	return 0;
}
