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

int main(){
	double x, h, y;
	while(scanf("%lf%lf", &x, &h) != EOF){
		if(x+y == 0)break;
		y = (x/2.0)*(x/2.0) + h*h;
		y = sqrt(y);
		printf("%f\n", x*y*2 + x*x);
	}
	return 0;
}