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 <cstdio>
#include <cmath>
using namespace std;
int main(){
  double x,h;
  while(1){
  cin >> x >> h;
  if(x == 0 && h == 0)break;
  double s = x*x+x*sqrt(pow(h,2)+pow((x/2),2))*2;
  printf("%.5f\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;
			
				printf("ru[%d]=%f\n",i,(double)ru);
			
			y=sqrt(ru);
			num[i]=(double)x*x+2*x*y;
					printf("num[%d]=%f\n",i,(double)num[i]);
			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>

using namespace std;

void solve()
{
	int x, h;
	while(cin >> x >> h)
	{
		if(x == 0 && h == 0)
		{
			break;
		}
		double surfaceArea = x * x;
		surfaceArea += 2 * (sqrt((x / 2.0) * (x / 2.0) + h * h) * x);
		printf("%.6f\n", surfaceArea);
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
	int x, h;
	while(cin >> x >> '\n' >> h){
		if(x == 0 && h == 0) break;
		double ans = x * x + 4 * (x * sqrt((x/2)*(x/2) + h*h) * 0.5);
		cout << ans << endl;
	}
}

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<bits/stdc++.h>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long int ll;
const ll MOD=1000000007;
const ll INF=1000000010;
const ll LINF=4000000000000000010LL;
const int MAX=310;
const double EPS=1e-8;
int dx[4]={0,0,1,-1};
int dy[4]={-1,1,0,0};
int main(){
	double x,h;
	while(cin>>x>>h,x+h){
		printf("%.8lf\n",x*x+2*(sqrt((x/2)*(x/2)+h*h))*x);
	}
		
}

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

int main(){
	
	int x,h,y,num=0;
	
	while(1){
	
	scanf("%d %d",&x,&h);
	
	y=sqrt(x*x+h*h);
	num=x*x+2*x*y;
	if((x==0)&&(h==0)){
			break;
	}
		
	printf("%d",num);
	
		
	}
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include"bits/stdc++.h"
#ifdef _DEBUG
#define DBG(n) n
#else
#define DBG(n)
#endif
#define INF         1e9
#define INFLL       1e18
#define EPS         1e-9
#define REP(i,n)    for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)   for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)   for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)  for(ll i=(n);i>0;--i)
#define REPC(i,obj) for(auto i:obj)
#define ALL(obj)    (obj).begin(),(obj).end()
#define SETP(n)     cout << fixed << setprecision(n)
using namespace std;
using ll = long long;
template<typename T = ll>inline T in() { T ret; cin >> ret; return ret; }

signed main()
{
	ll x, h;
	while (cin >> x >> h, x) {
		SETP(10);
		cout << x * x + sqrt(x * x * (4 * h * h + x * x)) << endl;;
	}
}

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

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

C++: #include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
#include<stack>
#include<cmath>
 
using namespace std;
 
#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)

int main(){
	int x,h;
	while(cin>>x>>h,h&x){
		
		double p = sqrt(x*x/4.0+h*h);
		double sum =0;
		sum+=x*x;
		sum+=x*p/2*4;
		
		printf("%.9lf\n",sum);
	}
}

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

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

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

int main(){
	double x, h, ans;
	while (cin >> x >> h) {
		if (x == 0 && h == 0) {
			break;
		}
		ans = x*(x+2.0*sqrt(h*h+0.25*x*x));
		cout << setprecision(20);
		cout << ans << endl;
	}
	return 0;
}

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

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

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

C++: #inlude <stdio.h>

#include <math.h>

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

C++: #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
double pi= 3.45192653589793;

int main(){
	double x,h;
	while(true){
		cin>>x>>h;
		if(x==0 && h==0){
			break;
		}
		double c = (x/2)*(x/2) + h*h;
		c=sqrt(c);
		cout<<setprecision(20)<<x*x+c*x*2<<endl;
	}
}

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

using namespace std;

int main (void) {
	for (;;) {
		double x, h;
		
		cin >> x;
		cin >> h;
		
		if (x == 0 && h == 0) {
			break;
		}
		
		double S = 0.0;
		S += pow(x, 2);
		S += 4 * (x * sqrt(pow(x / 2, 2) + pow(h, 2)) / 2);
		
		cout << S << endl;
	}
	
	return 0;
}

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

using namespace std;

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

C++: #include <bits/stdc++.h>
using namespace std;
int main(void){
    double x,h;
    while (cin>>x>>h) {
        if (x==0&&h==0) {
            break;
        } else {
            double S=0.0;
            S=S+x*x;
            double H=sqrt(h*h+(x/2)*(x/2));
            S=S+(x*H/2)*4;
            printf("%.6f",S);
            cout<<endl;
        }
    }
}