#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <string>
#include <sstream>
#include <stack>
#include <iomanip>
#include <numeric>
#include <queue>
#include <climits>
#include <set>
#include <complex>
#include <cmath>
#include <map>
using namespace std;
using ll = long long;
#define MOD 1000000007
#define INF 1LL << 59

int main()
{
    //std::ios::sync_with_stdio(false);
    //std::cin.tie(0);
    cout << fixed << setprecision(7);

    int x, h;
    while (cin >> x >> h)
    {
        if (x == 0 && h == 0)
            break;
        long double t = (double)x * x / 2.0 + (double)h * h - (double)x * x / 4.0;

        double lb = 0.0, ub = 100000.0;
        for (int i = 0; i < 100; ++i)
        {
            double mid = (lb + ub) / 2;
            if (t > mid * mid)
            {
                lb = mid;
            }
            else if (t < mid * mid)
            {
                ub = mid;
            }
            else
            {
                lb = mid;
                break;
            }
        }
        cout << (double)2.0 * x * (double)lb + x * x
             << endl;
    }
    return 0;
}
