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

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