#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
#define INF 114514
using namespace std;



int main(){
	while (1) {
		double h, x;
		cin >> x >> h;
		if (x == 0 && h == 0) return 0;
		printf("%.6f", x*x + sqrt(x / 2 * x / 2 + h*h) * 2 * x);
	}
	return 0;
}