//18
#include<iostream>
#include<cmath>
#include<iomanip>

using namespace std;

int main(){
  for(double x,h;cin>>x>>h,x!=0||h!=0;){
    cout<<fixed<<setprecision(5)<<x*x+2*x*sqrt(x*x/4+h*h)<<endl;
  }
  return 0;
}