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

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