#include <cmath>
#include <cstdio>
#include <iostream>

using namespace std;

int main() {

	int x, h;
	double S;

	while(cin >> x >> h) {
		if(x==0&&h==0)
			break;
		S=(x*x+x*sqrt((double)(x*x+4*h*h)));
		printf("%.6f\n", S);
	}

	return 0;

}