#include <iostream>
#include <math.h>
#include <stdio.h>

using namespace std;

int main(){

	float x,h;
	float ans;
	float skseki;

	while(1){

		cin >> x >> h;

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

		float tei = x * x;
		float skmnh = x/2 * x/2 + h * h;
		
		skmnh = sqrt(skmnh);
		skseki = skmnh * x / 2 * 4;
		ans = skseki + x * x;

		printf("%f\n", ans);
	}

	return 0;
}