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

int main(){
  double x, h;
  while (cin >> x >> h) {
    if (x == 0 && h == 0) break;
    double y = sqrt(h * h + (x * 0.5) * (x * 0.5));
    double ans = x * x + x * y * 0.5 * 4;
    cout << fixed << setprecision(6) << ans << endl;
  }
}

