#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstdio>
#include <cmath>
using namespace std;

int main()
{
	while(1){
		double x, h;
		cin >> x >> h;
		if (x == 0 && h == 0)
		{
			break;
		}
		double S, H;
		H = sqrt(x * x + x * x) / 2;
		H = sqrt(H * H + h * h);
		H = sqrt(H * H - x * x / 4);
		S = x * x + x * H * 2;
		cout << S << endl; 
	}	
}