#include <iostream>
#include <cmath>

using namespace std;

int main() {

	double x, h, S;

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

	return 0;

}