/*
	0073:Surface Area of Quadrangular Pyramid
*/
#include	<iostream>
#include	<cstdio>
#include	<cmath>

using namespace std;

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