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<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<string.h>
#include<vector>
#include<math.h>
#include<queue>
#include <algorithm>
#include<functional>
#include<cstdlib>
#include<cmath>


#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define CI cin >>
#define CO cout <<
#define E << endl;

using namespace std;

typedef pair<int, int> P;
typedef pair<long, long> LP;
typedef pair<int, P> PP;
typedef pair<long, LP> LPP;



int dy[] = { 0, 0, 1, -1, 0 };
int dx[] = { 1, -1, 0, 0, 0 };


double X = 0;
double H = 0;

void input(void) {
	CI X;
	CI H;

	return;
}


int main(void) {
	while (1) {
		input();
		if (X == 0 && H == 0) {
			return 0;
		}
		CO X * X + 2 * X * sqrt(H * H + X * X / 4.0) E
	}

	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	long long int a = 0;
	long long int b = 0;
	while (cin >> a, cin >> b)
	{
		long long int c = 0;
		c = a*a*(a*a + 4*b*b) * 10000000000;
		long long int d = 0;
		d = sqrt(c);
		cout << a * a + d / 100000 << '.' << d % 100000 << endl;

	}
	

	return 0;
}

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

int main(){
  int x,h;
  while(scanf("%d%d",&x,&h),x||h){
    double a = (double)x/2;
    a = sqrt(h*h+a*a);
    printf("%.9lf\n",2*a*x+x*x);
  }
}

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

int main(){
  double x,h;
  while(cin>>x>>h&&x){
    double a=x*x;
    a+=sqrt(h*h+a/4)*x*2;
    printf("%f\n",a);
  }
  return 0;
}

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

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

  while (1) {
    cin >> x >> h;
    if (!x && !h) break;
    s = x*x + 2*x*sqrt(h*h+x*x/4.0);
    cout.setf(ios::fixed);
    cout.precision(6);
    cout << s << endl;
  }
  return 0;
}

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

using namespace std;

int main(){

	float x,h;
	float ans;
	float skseki;

	while(1){

		cin >> x >> h;

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

		float tei = x * x;
		float skmnh = x/2 * x/2 + h * h;
		
		skmnh = sqrt(skmnh);
		skseki = skmnh * x / 2 * 4;
		ans = skseki + x * x;

		printf("%6f\n", ans);
	}

	return 0;
}

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

# define REP(i,n) for(int i=0; i<n;i++)

using namespace std;

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

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

int main(void)
{
	double a;
	double h;
	double s;
	
	while (scanf("%lf\n%lf", &a, &h), a != 0 ||  h != 0){
		s = 4 * h * h + a * a;
		s = sqrt(s);
		s = a * s + a * a;
		
		printf("%lf\n", s);
	}
	return (0);
}

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

int main()
{
	double x, h;
	while( std::cin >> x >> h, x || h )
	{
		double t = sqrt( x * x / 4.0 + h * h );

		std::cout << std::fixed << std::setprecision( 6 ) << x * t * 2.0 + x * x << std::endl;
	}

	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <cassert>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <cstring>
#include <stack>
#include <queue>
#include <map>
#include <bitset>
#include <sstream>
#include <istream>
#include <cmath>
#include <cstdio>

using namespace std;

#define vci vector<int>
#define vcs vector<string>
#define pb push_back
#define sz size()
#define mapii map<int, int>
#define mapci map<char, int>
#define mapsi map<string, int>
#define all(x) x.begin(), x.end()
#define minit(a, i) memset(a, i, sizeof(a));

#define for_(i, a, b) for (int i=(int)a; i<(int)b; i++)
#define for_d(i, a, b) for (int i=(int)a-1; i>=b; i--)
#define for_r(i, a, b, c) for (int i=(int)a; i<(int)b; i += c)
#define for_dr(i, a, b, c) for (int i=(int)a-1; i>=b; i -= c)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

typedef long long ll;
typedef double D;

const int iINF = 2147483647;
const ll lINF = 9223372036854775807;

template <class T> inline void dbg(T t) { cout << t << endl; }

D EPS = 1e-5;

int main() {
	int X, H;
	
	while (1) {
		cin >> X >> H; if (X==0 && H==0) break;
		
		D x = (D)X, h = (D)H;
		D y = sqrt((x/2.0)*(x/2.0) + h*h);
		D ans = (y*x/2.0)*4.0 + x*x;
		
		ans -= EPS;
		printf("%lf\n", ans);
	}
	
	return 0;
}

C++: #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,b) FOR(i,0,b)
#define BE(c) c.begin(),c.end()
#define PB push_back
#define F first
#define S second
#define BEB(s) s
using namespace std;
int main(){
	double x,h;
	while(1){
		cin>>x>>h;
		if(!x&&!h)break;
		printf("%.6f\n",sqrt((x/2)*(x/2)+h*h)*x*2+x*x);
		
	}
	return 0;
}

C++: #include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int main(void)
{
    double x,h,A1,A2,x1;
    while(1){
        cin>>x>>h;
        if(x==0&&h==0)break;
        A1=x*x;
        x1=x/2;
        A2=(x1*x1)+(h*h);
        A2=sqrt(A2);
        A2*=x;
        A2*=2;
        printf("%lf\n",A1+A2);
    }
}

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

int main()
{
	while(1){
		double X, Ha;
		cin >> X >> Ha;
		if (X== 0 && Ha == 0)
		{
			break;
		}
		double x = (double)X;
		double h = (double)Ha;
		double S, H;
		H = sqrt(x * x + x * x) / 2;
		H = sqrt(H * H + h * h);
		H = sqrt(H * H - x * x / 4);
		S = x * x + x * H * 2;
		printf("%.10f\n", S);
	}	
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>

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);
	}
}

C++: #include<stdio.h>
#include<math.h>
int main(void)
{
	int x,h,n;
	double s,y;

	scanf("%d %d",&x,&h);
	while(x!=0 && h!=0){
		n=(x/2)*(x/2)+h*h;
		y=sqrt(n);
		s=x*x+x*y/2*4;
		printf("%lf\n",s);
		scanf("%d %d",&x,&h);
	}
	return 0;
}

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

using namespace std;

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

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

int main(){

  int x,h;
  double sum;

  while(cin >> x >> h , x&&h){
    sum = x*x;
    sum += x* sqrt(h*h+(x/2.0)*(x/2.0)) / 2.0 *4;
    printf("%.6f\n",sum);
  }


  return 0;

}

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

int main()
{
	while(1){
		double X, Ha;
		cin >> X >> Ha;
		if (X== 0 && Ha == 0)
		{
			break;
		}
		double x = (double)X;
		double h = (double)Ha;
		double S, H;
		H = sqrt(x * x + x * x) / 2;
		H = sqrt(H * H + h * h);
		H = sqrt(H * H - x * x / 4);
		S = x * x + x * H * 2;
		cout << S << endl; 
	}	
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	long long int a = 0;
	long long int b = 0;
	while (1)
	{
		cin >> a;
		cin >> b;
		if (a == 0 && b == 0)
		{
			break;
		}
		long long int c = a*a*(a*a + 4 * b*b) * 10000000000;
		long long int d = sqrt(c);
		cout << a * a + d / 100000 << '.' << d % 100000 << endl;
	}
	
	
	return 0;
}