#include<iostream>
#include<iomanip>
#include<cmath>

using namespace std;

int main() {
	
	double x, h;
	double ans;
	
	while(cin >> x >> h) {
		
		ans = 0;
		
		if( x == h && h == 0)
			break;
			
		ans = x * x + sqrt( (x / 2) * (x / 2) + h * h) * x * 2;
			
		cout << fixed << setprecision(6) << ans << "\n";
		
	}
	
	return 0;
}

