#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip> 
#include <complex> 
#include <string>
#include <vector> 
#include <list>
#include <deque> 
#include <stack> 
#include <queue> 
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <utility>
#include <algorithm> 
#include <numeric> 
#include <typeinfo> 
#include <cstdio>
#include <cstdlib> 
#include <cstring>
#include <cmath>
#include <climits> 
#include <ctime>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;

int main(){
	double x,h;
	while(~scanf("%lf",&x)){
		scanf("%lf",&h);

		if(x==h && x==0) break;

		double a = x / 2.0;
		double b = sqrt(a*a + h*h);

		printf("%0.7f\n",x*b*2.0+x*x);
	}
	return 0;
}