import java.io.FileInputStream; import java.io.InputStreamReader; import java.io.StreamTokenizer; public class cylinder { public static void main(String[] args) throws Exception { StreamTokenizer st = new StreamTokenizer(new InputStreamReader(new FileInputStream("cylinder.in"))); double w = 1.0, h=1.0; while(true) { st.nextToken(); w = st.nval; st.nextToken(); h = st.nval; if(w == 0.0 || h == 0.0) break; long val = Math.round(1000.0 * calc(w,h)); double x = val / 1000.0; System.out.println(x); } } public static double calc(double w, double h) { double r1=0.0, r2=0.0, r3=0.0; if(w<=((h-w)/Math.PI)) { double r = w / 2.0; r1 = (Math.PI * r * r) * w; //System.out.println("r1: " + r1); } double x = w/Math.PI; double r = x / 2.0; if(h-x>0.0) { r2 = (Math.PI * r * r) * (h-x); //System.out.println("r2: " + r2); } x = h/(Math.PI+1.0); r = x/ 2.0; if(w>=(h-x)/Math.PI) { r3 = (Math.PI * r * r) * w; //System.out.println("r3: " + r3); } return Math.max(r1, Math.max(r2,r3)); } }