#include <iostream>
#include <math.h>
#include <stdio.h>
using namespace std;

int main(void)
{
	double a, h;

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