#include<iostream>
#include<cmath>
using namespace std;
int main(){
	int x, h;
	while(cin >> x >> '\n' >> h){
		if(x == 0 && h == 0) break;
		double ans = x * x + 4 * (x * sqrt((x/2)*(x/2) + h*h) * 0.5);
		cout << ans << endl;
	}
}