#include<bits/stdc++.h>
using namespace std;

main(){
	while(true){
		double x, h;
		cin >> x >> h;
		
		if(x==0){
			break;
		}
		
		double H = sqrt(x*x*0.25+h*h);
		
		printf("%.5f\n",x*x + x*H/2.0*4.0);
	}
}
