1.

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.DecimalFormat;
import java.util.StringTokenizer;

/**
* ACM Training
* ACM Problem # 11232 - Cylinder
* Link: http://uva.onlinejudge.org/external/112/11232.pdf
*
* @author Felix Dietrich
* @author Dennis Wilfert
* @version 1.0, 04/08/2009
*
* Methode: Analytische Geometrie
* Status : Accepted
* Runtime: 0.872
*/

public class Main
{
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

public static void main(String... strings) throws IOException
{
String input;
StringTokenizer st;
while ((input = br.readLine()) != null)
{
if (input.length() < 2)
continue;

st = new StringTokenizer(input);
double width = Integer.parseInt(st.nextToken());
double height = Integer.parseInt(st.nextToken());

if (width == 0 && height == 0)
return;

double temp = width;
if (temp > height)
{
width = height;
height = temp;
}

/*
* Grundgedanke:
* der erste Teil des Papiers hat die Höhe b = 2r.
* Das Verhältnis zwischen dem Umfang und b ist immer PI.
*
* also x/b = pi oder (y-b)/b = pi
*/

double vResult;

// Radius bei x > 2 pi r
double rWidth = width / (2.0 * Math.PI);
// Radius bei x < 2 pi r
double rHeight = Math.min(width / 2.0, height / (2.0 * (Math.PI + 1)));

// Das Ergebnis ist das maximum aus rwidth*height und rheight * width
vResult = Math.max(volumen(rHeight, width), volumen(rWidth, height - 2 * rWidth));

DecimalFormat df = new DecimalFormat();
df.applyPattern("#0.000");
System.out.println(df.format(vResult));
}
}

private static double volumen(double r, double h)
{
return r * r * Math.PI * h;
}
}


2.

/**
* ACM Training, SS09
* ACM Problem #11232 - Cylinder
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=2173
*
* @author Doina Logofatu
* @version 1.0, 06/08/2009
*
* Methode: Math
* Status : Accepted
* Runtime: 0.012
*/

#include <stdio.h>
#include <math.h>

#define SQR(x) ((x)*(x))
#define MAX(a, b) ((a)>(b)?(a):(b))

#define PI 2*acos(0.0)

int main() {

double w, h;
double res;

while(scanf("%lf%lf", &w, &h)==2 && (w||h)){

res = w*PI*SQR(h/(1+PI)/2);
if(h/(1+PI)>w) res = PI*w*SQR(w/2);

printf("%.3lf\n", MAX( res, (PI*h-w)*SQR(w/(2*PI))));

}

return 0;

}