#include <iostream>
#include <stdio.h>
#include <cmath>
#include <algorithm>
using namespace std;
int main(void){
    double x,y;
    while(true){
        cin >> x >> y;
        if(x==0 && y==0)break;
        printf("%.6lf\n",x*x+2*x*sqrt(y*y+(x/2)*(x/2)));
    }
    return 0;
}
