#include<bits//stdc++.h>
using namespace std;
int main(){
	while(true){
		double a;
		double b;
		cin>>a;
		cin>>b;
		if(a==0&&b==0) break;
		double c=a*a;
		a/=2;
		double d=sqrt(b*b+a*a);
		c+=a*d*4;
		printf("%.10lf",c);
	}
}