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

int main() {
  while(1) {
    int x, h;
    double area,x2;
    cin >> x >> h;
    if(x==0 && h==0) break;

    area=x*x;
    x2=(double)x/2;
    area+=(double)2*sqrt(h*h+x2*x2)*x;

    printf("%f\n",area);
  }
  return 0;
}
