#include <iostream>
#include <cmath>
#include <cstdio>
#include <iomanip>
using namespace std;
int main(void){
double x,h;
while(cin >> x >> h){
    if(x==0 && h==0)
    break;
    double s = x*x+sqrt(h*h+x*x/4)*x/2*4;
    cout << fixed << setprecision(6) << s <<endl;
}
  return 0;
}
