#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <bitset>
 
#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif


int main(int argc, char **argv){
	int x, h;

#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
	//FILE *fp = fopen("test.txt", "r");
#endif

#if INPUT_FROM_FILE
	while(ifs >> x >> h){
#else
	while(std::cin >> x >> h){
#endif
		if(x == 0 && h == 0){ break; }

		double S = x * x + 2 * x * sqrt(x * x / 4.0 + h * h);

		printf("%.6lf\n", S);

	}


 
#if INPUT_FROM_FILE
	//fclose(fp);
#endif
    return 0;
}
