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 <math.h>

int main(){
    int x,h;
    double sBtm, sSide;
    
    while (scanf("%d\n%d",&x,&h)){
        if (x==0 && h==0) break;
        sBtm = x*x;
        sSide = x * sqrt(x*x/4.0 + h*h)/2.0;
        printf("%f\n",sSide*4+sBtm);
    }
    
    return 0;
}

C++: #include<bits//stdc++.h>
using namespace std;
int main(){
	while(true){
		double a;
		double b;
		cin>>a;
		cin>>b;
		if(a==0&&b==0) break;
		double c=a*a;
		a/=2;
		double d=sqrt(b*b+a*a);
		c+=a*d*4;
		printf("%.10lf",c);
	}
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int main( void )
{
	int x, h;
	while ( cin >> x >> h && x && h )
	{
		double xx = x;
		double S = xx * xx;

		double hh = sqrt( ((xx/2.0)*(xx/2.0)) + (h*h) );

		S += hh * xx / 2.0 * 4.0;

		cout.setf(ios::fixed);
		cout.precision( 6 );
		cout << S << endl;

	}
	return 0;
}