#include<iostream>
#include<vector>
#include<string>
#include<math.h>
#define double long double
using namespace std;

int main() 
{
	double a, b, c;
	while (cin >> a >> b, (int)a | (int)b) {
		double s = a*a;
		double m = sqrt(a / 2 * a / 2 + b*b);
		s += a*m * 2;
		cout << s << endl;
	}
}