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