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<cstdio>
#include<iostream>
#include<math.h>
using namespace std;

int main(){


  while(1){
    int x,h;
    double s,a,b;
    
    scanf("%d %d",&x,&h);
    if(x==0 && h==0) break;

    s=x*x;
    a=x/2.;
    b=sqrt(a*a+h*h);
    
    s+=x*b*2;

    printf("%f\n",s);
  }

  return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(x) for(auto it=(x).begin();it!=(x).end();it++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vi vector<int>
#define INF (int)1e9
#define INFL 1e18
//#define MOD 1000000007
#define pb push_back
#define MP make_pair
#define PI 3.1415926535
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

using namespace std;

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

C++: #include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int main(){
	int x, h;
	while(cin >> x){
		cin >> h;
		if(x == 0 && h == 0) break;
		double s = x * x + 4 * (x * sqrt((x*0.5)*(x*0.5) + h*h) * 0.5);
		cout << fixed << setprecision(6) << s << endl;
	}
}

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

using namespace std;

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

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

using namespace std;

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

C++: #include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;main(){double x,y;while(cin>>x>>y,x,y)printf("%.6lf\n",x*x+2*x*sqrt(x/2*(x/2)+y*y));}

C++: #include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
 
int main(){
  while(1){
  double dh,S,x,h,t;
  cin>>x>>h;
  if(x+h==0) break;
  S=x*x;
  dh=sqrt(h*h+(x/2)*(x/2));
  t=4*dh*x/2;
  S+=t;
  printf("%f\n",S);
  }
 
  
  return 0;
}

C++: #include <iostream>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
using namespace std;
int main(){
	
	int x,h;
	double t,s;
	while(cin>>x>>h){
		if(x!=0&&h!=0){
			t=sqrt(pow((double)x/2,2)+pow(h,2));
			s=pow(x,2)+(double)(x*t)*2;
		
		printf("%.6f\n",s);
		}
		else
			break;
	}
	
}

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

using namespace std;

int main() {

	int x, h;
	double S;

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

	return 0;

}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  double x,h;
  while(1){
    scanf("%lf %lf",&x,&h);
    if(x==0 && h==0) break;
    double soku = sqrt(((double)x*0.5) * ((double)x*0.5)+ (double)h*(double)h);
    printf("%f",(double)x*(double)x + (double)4 * (soku * (double)x * 0.5));
  }
}

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

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

C++: #include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int p, q; double s;
int main() {
	while (1) {
		cin >> p >> q;
		if (!p) { break; }
		s += p*p;
		s += 2.0*p*sqrt((((p*p) / 4) + q*q));
		cout << fixed << setprecision(15) << s << endl;
	}
}

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

int main(){
double x,h,c,a;
while(1){
scanf("%lf%lf",&x,&h);
if(x==0&&h==0)break;
c=4*h*h+x*x;
c=sqrt(c);
a=x*c+x*x;
printf("%f\n",a);




return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
	while(1){
        double x;
        double h;
        double h1;
        cin >> x >> h;
        if(x == 0 && h == 0) break;
        double sum = 0;

        h1 = hypot((x/2),h);
        sum += x * x;
        sum += x * h1 * 2;
        printf("%.6lf\n",sum);
	}
	return 0;
}

C++: #include<stdio.h>
#include<math.h>
 
int main(){
    int  a,b;
    while(1){
        scanf("%d%d",&a,&b);
        if(!(a|b))return 0;
        printf("%lf\n",2*sqrt(((double)a/2)*((double)a/2)+b*b)*a+a*a);
    }
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
template<typename V> constexpr typename V::value_type sum(const V &v) { return accumulate(all(v), 0); }
void solve();
main { solve(); return 0; }
// clang-format on

void solve() {
  double x, h;
  while (cin >> x >> h, x) {
    cout << prec(8) << x * x + x * hypot(h, x / 2) * 2 << endl;
  }
}

C++: #include<iostream>
#include<stdio.h>
#include<cmath>
using namespace std;
int main(){
	double x,h;

while(1){
	cin>>x;
	cin>>h;


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

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