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 <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;

double x, h, S;

int main(){
	while (cin >> x >> h&&x + h){
		printf("%.8lf\n", x*x + 2 * (sqrt(pow(x / 2, 2) + pow(h, 2)))*x);
	}
}

C++: #include <stdio.h>
#include <math.h>

int main(void)
{
	for(;;)
	{
		float a,b,c,d,e,f,ans;
		scanf("%f %f",&a,&b);
		if(a==0&&b==0)
		{
			break;
		}
		c=a/2*a/2+b*b;
		d=sqrt(c);
		ans=a*d/2*4+a*a;
		printf("%f\n",ans);
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>

using namespace std;

int main(){
  double x, h;
  while(cin >> x >> h && x != 0 || h != 0) {
    printf("%f\n", 1.0 * x * ( x + sqrt(4.0 * h * h + x * x)));
  }
  
  return 0;
}

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <cassert>

using namespace std;


bool solve(){
	double x,h;
	while(1){
		cin>> x>> h;
		if(x==0&&h==0) break;
		double ans = x*x + sqrt(x*x*x*x + 4*x*x*h*h);
		cout<< ans<< endl;
	}
	return true;
}

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	solve();
	return 0;
}

C++: //0073
#include <bits/stdc++.h>
using namespace std;

int main(){
	double x,h,S_ans,S_teimen,S_sokumen;
	while(cin>>x>>h,x != 0&&h != 0){
		S_teimen = x * x;
		S_sokumen = 2 * x * sqrt(pow(x/2,2)+pow(h,2));

		S_ans = S_teimen + S_sokumen;
		printf("%0.7f\n",S_ans );
	}
	return 0;
}

C++: #include <cstdio>
#include <math.h>

int main(){
    int x, h;
    double S;

    for(;;){
        scanf("%d", &x);
        scanf("%d", &h);
        if(x == 0 && h == 0) break;
        double th = sqrt(((double)x/2*(double)x/2)+(h*h));
        S = x * x;
        S += 4 * ((double)x * th / 2);
        printf("%f\n", S);
    }

    return 0;
}

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

int main() {
    while (true) {
        int x, h;
        cin >> x >> h;
        if (x == 0 && h == 0) {
            break;
        }

        double s = 0;
        s += x * x;
        s += 2 * x * sqrt(pow((double)x / 2, 2) + pow(h, 2));
        printf("%.6f\n", s);
    }
}

C++: #include<stdio.h>
#include<math.h>

int main(){
	
	int x,h,i,con=0;
	double ru=0,num[200]={0},y;
		for(i=0;;i++){
	scanf("%d %d",&x,&h);
			
			ru=(double)x*x/4+h*h;
			y=sqrt(ru);
			num[i]=(double)x*x+2*x*y;
			con=con+1;
	if((x==0)&&(h==0)){
			con=con-1;
			break;
		}
	}
	for(i=0;i<con;i++)printf("%f\n",(double)(num[i]));
	return 0;
}

C++: #include <iostream>
#include <math.h>
#include <stdio.h>

using namespace std;

int main(){
	double s;
	int x,h;
	double c;

	while(cin>>x){
		cin>>h;
		if(x==0&&h==0) break;
		c = sqrt(h*h + x*x/(double)4);
		printf("%.6f\n",(double)(x*x+2*x*c));
	}
	return 0;
}

/*
Sample Input
6
4
7
9
0
0
Output for the Sample Input
96.000000
184.192455 
*/

C++: #include<stdio.h>
int main(void)
{
         int a,b,x;
		 scanf("%d",&a);
		 scanf("%d",&b);
		 x=(a*a)+(b*4);
		 printf("%d\n",x);
		 return 0;
		 }

C++: int main()
{
	double x, h;
	while(cin >> x >> h && (x || h))
		cout << setprecision(10) << x * x + x * sqrt(x * x / 4 + h * h) * 2 << endl;
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
#define INF 114514
using namespace std;



int main(){
	while (1) {
		double h, x;
		cin >> x >> h;
		if (x == 0 && h == 0) return 0;
		printf("%.10f", x*x + sqrt(x / 2 * x / 2 + h*h) * 2 * x);
	}
	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;

int main(){
	double x,h;
	
	while(1){
		scanf("%lf %lf",&x,&h);
		if(x+h==0) break;
		else printf("%lf\n",(x*x)+2*x*sqrt((h*h)+((x/2)*(x/2))));
	}
	return 0;
}

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\n",kotae);
	}
	
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
double f(double x, double y){
  return sqrt(x * x + y * y);
}

int main(){
  double X, H;
  while(cin >> X >> H && (X + H > 0)){
    double h = f(X / 2, H);
    printf("%.16lf\n", X * X + 4.0 * X * h * 0.5);
  }
  return 0;
}

C++: #include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int main(){
	float x1,x2,x3, h ,h2, s , l;
	while(cin>>x1>>h){
		if(x1==0&&h==0)break;
		x2 = x1 / 2;
		x3=pow(x2,2);
		h2=pow(h ,2);
		x2 += h2;
		s =sqrt(x3+h2);
		
		l = (x1*s)/2;
		printf("%f\n",((4*l)+(x1)*(x1)));
	}
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

int main()
{
	for(int x,h;cin>>x>>h,x|h;printf("%f\n",x*x+2*x*hypot(h,0.5*x)))
		;
	
	return 0;
}

C++: #include <iostream>
#include <string>
#include <iomanip>
#include <math.h>
using namespace std;

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

C++: #include<bits/stdc++.h>
using namespace std;

double x,y;

bool input(){
  cin>>x>>y;
  return (x!=0)||(y!=0);
}


double solve(){
  double tmp = sqrt((x/2)*(x/2)+y*y);
  return (x*x) + 4* x*tmp/2;
}

int main(){
  while(input()){
    cout<<setprecision(100)<<solve()<<endl;
  }
}

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

int main() {
	int x,h;
    while(1){
        cin>>x>>h;
        if(!x&&!h)break;
        double s=(double)x*sqrt((double)x*(double)x+4*(double)h*(double)h)+(double)x*(double)x;
        printf("%f\n",s);
    }
	return 0;
}

C++: #include<iostream>
#include<math.h>
#include<cstdio>
using namespace std;

int main(){
	double a,b,c;
	double x,y;
	double s;
	while(cin>>x>>y,y!=0){
	a=x/2;
	b=y;
	c=sqrt(a*a+b*b);
	s=x*x+4*x*c/2;
	printf("%.9f\n",s);
	}
	

}