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<sstream>
#include<algorithm>
#include<cmath>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<deque>
using namespace std;

int main() {

    double x, h;
    while(cin >> x >> h && (x || h) ) {
        printf("%.6f", x * sqrt(x * x + 4 * h * h) + x * x);
        cout << endl;
    }
     
    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",(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() {

	int x, h;
	double S;

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

	return 0;

}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main() {
	long double x, h;
	while (cin >> x >> h, x) {
		printf("%.20f\n", x*x + 4 * (sqrt(x*x / 4 + h*h)*x / 2));
	}
}

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

using namespace std;

int main(){
  while(true)
  {
    double x, h;
    cin >> x >> h;
    if(!x && ! h)
      break;
    double hh =	sqrt(h * h + (x / 2) * (x / 2));
    printf("%lf\n", x * x +  x * hh / 2.0 * 4.0);
  }
  return 0;
}

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

C++: #include <cstdio>
#include <cmath>
using namespace std;
int main()
{
	int x, h;
	while (scanf("%d%d", &x, &h))
	{
		if (x == 0.0 && h == 0.0) break;
		printf("%.6f\n", (4.0*(sqrt(double(h*h)+double(x*x)/4.0)*x))/2.0+x*x);
	}
}

C++: #include <iostream>
#include <string>
#include <cstdio>
#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);
		
		printf("%lf\n", S);
	}
	
	return 0;
}

C++: #include <stdio.h>
#include <math.h>
int main()
{
	int x,h;
	float S;
	while(1){
		scanf("%d %d",&x,&h);
		if(x==0&&h==0)
			break;
		S=x*x;
		S+=x*sqrt(0.5*x*0.5*x+h*h)*2;
		printf("%f\n",S);
	}
	return 0;
}

C++: //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
#include <math.h>

using namespace std;

//conversion
//------------------------------------------
inline long toLong(string s) {long v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(long i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

const double EPS = 1e-9;
const double INF = 1e9;



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

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

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

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

C++: #include <bits/stdc++.h>

#define loop(v, f, l) for(int v = (f), v##_ = (l); v < v##_; ++v)

using namespace std;

typedef long long int lint;
static inline int in(){ int x; scanf("%d", &x); return (x); }
static inline lint inl(){ lint x; scanf("%lld", &x); return (x); }

int main()
{
	int x;
	int h;
	while( 1 )
	{
		scanf("%d%d", &x, &h);
		if( x == 0 && h == 0 )break;

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

C++: #include<iostream>
#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 << s << endl;
	}
}

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

using namespace std;

int main(void){
  double x,h;
  while(cin >> x >> h,x&&h)
    printf("%.6f\n",x*x+sqrt((x*x)/4+h*h)*x*2);

  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("%5f\n", ans);
	}

	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<cmath>
using namespace std;
double x,h,s,b;
int main(){
    for(;;){
        cin>>x>>h;
        if(x==0||h==0)break;
        b=h*h+x*x/4;
        double d=sqrt(b);
        b=x*d/2;
        x=x*x;
        s=x+b*4;
        printf("%f\n",s);
    }
return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main() {
	long double x, h;
	while (cin >> x >> h, x) {
		printf("%.20f\n", x*x + 4 * (sqrt(x*x / 4 + h*h)*x / 2));
	}
}

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

int main(void){
  int x, h;
  while(cin >> x >> h && x != 0 && h != 0){
    double S = x * sqrt(4 * h * h + x * x) + x * x;
    printf("%.6lf\n", S);
  }
  return 0;
}

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

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

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

using namespace std;

int main(int argc, char const* argv[])
{
	double x,h,S;

	while( cin >> x >> h && x != 0 ){
		double x2 = x/2;
		double l = sqrt( x2 * x2 + h * h );
		S = l * x * 2 + x * x;
		printf("%.6f\n",S);
	}
	return 0;
}