#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;

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