Go: package main

import (
	"fmt"
	"math"
)

func main() {
	x := -1
	h := -1
	for {
		fmt.Scan(&x)
		fmt.Scan(&h)
		if x == 0 && h == 0 {
			return
		}

		f_x := float64(x) / 2.0

		sya := math.Sqrt(f_x*f_x + float64(h*h))
		fmt.Println(float64(x*x) + float64(x)*sya*2.0)

	}
}

C++: #include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip> 
#include <complex> 
#include <string>
#include <vector> 
#include <list>
#include <deque> 
#include <stack> 
#include <queue> 
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <utility>
#include <algorithm> 
#include <numeric> 
#include <typeinfo> 
#include <cstdio>
#include <cstdlib> 
#include <cstring>
#include <cmath>
#include <climits> 
#include <ctime>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;

int main(){
	double x,h;
	while(~scanf("%lf",&x)){
		scanf("%lf",&h);

		if(x==h && x==0) break;

		double a = x / 2.0;
		double b = sqrt(a*a + h*h);

		printf("%0.7f\n",x*b*2.0+x*x);
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
int w,h;
float ans;
while(1){
cin>>w>>h;
if(w==0&&h==0){
break;
}
ans=(float)w*w*2.0+w*h*6.0;
cout<<ans<<endl;
}
}

C++: #include<iostream>
#include<cmath>
#include <cstdio>
using namespace std;
int main(){
	double x,h,seihou = 0,naname = 0,y = 0,sannkaku = 0,kotae = 0;
	
	
	while(true){
		cin >> x >> h;
		if(x == 0 && h == 0){
			break;
		}
		seihou = x * x;
		y = x/2;
		naname = sqrt(y*y + h*h) ;
		sannkaku = x * naname * 4 / 2;
		kotae = sannkaku + seihou;
		printf("%.6f",kotae);
	}
	
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
using namespace std ;

int main()
{
	double x,h ;
	double high = 0 ;

	while( cin >> x >> h )
	{
		if( x == 0 && h == 0 )	break ;

		high = sqrt( h*h + (x*x)/4 ) ;
		printf("%lf\n", (x*x)+(high*x/2*4)) ;
	}
	return 0 ;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#define shosu(x) fixed<<setprecision(x)
using namespace std;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,P> pip;
const int inf=(1<<31)-1;

double x,y,h,S;

int main(){
	cout<<shosu(7);
	while(1){
		cin>>x>>h;
		if(!x&&!h) break;
		S=x*x;
		x/=2;
		y=sqrt(x*x+h*h);
		cout<<4*(x*x+x*y)<<endl;
	}
}

C++: #include<bits//stdc++.h>
using namespace std;
int main(){
	double a,b;
	while(cin>>a>>b,a||b){
		double c=a*a;
		a/=2;
		double d=sqrt(b*b+a*a);
		c+=a*d*4;
		printf("%.10lf\n",c);
	}
}

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <sstream>
#include <algorithm>
#include <math.h>
//#include <map>
#include <iomanip>
#include <vector>

using namespace std;



int main()
{
	double x, h, ans;
	
	cout << fixed << setprecision(6);
	while (cin >> x >> h)
	{
		if (x == 0 && h == 0) break;
		ans = 2*x*sqrt(h*h+x*x/4) + x*x;
		cout << ans << endl;
	}
	
	return 0;
}