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

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