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

int main(){
  double S,nx,nh;
  int x,h;

  for(;;){
    cin >> x >> h;
    if(x == 0 && h == 0) break;
    nx = (double)x;
    nh = (double)h;
    S = sqrt(4*nh*nh+nx*nx)+nx*nx;
    printf("%.6f\n" ,S);
  }

  return 0;
}