1.

/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, SS11
* Problem: 10297 beavergnaw
* Link:
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=14&page=show_problem&problem=1238
*
* @author Bastian Hoecker
* @author Philipp Hauck Thalheim
* @version 1.0, 05/11/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.100
*/


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


public class Main {

public static void main(String...args) throws IOException
{
BufferedReader reader = new BufferedReader(new
InputStreamReader(System.in));
StringTokenizer st;
boolean finish = false;
double T=6/Math.PI;
while(!finish){
st = new StringTokenizer(reader.readLine());
int D = Integer.parseInt(st.nextToken());
int V = Integer.parseInt(st.nextToken());

if(D==0&&V==0)
{
break;
}
double SUM = Math.exp((Math.log(D*D*D-V*T)/3));
System.out.printf("%.3f%n",SUM);
}


}
}

---------------------------------------------------

1.
/*
* ACM Contest training
* Problem: 10297 - Beavergnaw
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=14&page=show_problem&problem=1238
*
* @author Patrick Bedat, Philippe Brousse, Christoph Goettschkes
* @version 1.0, 11/14/2010
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.088
*/

import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;

import java.util.*;

import java.math.BigInteger;

class Main {

static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

public static void main(String[] agrs) throws IOException {
int D, V;

do {
String[] in = reader.readLine().split(" ");
D = Integer.parseInt(in[0]);
V = Integer.parseInt(in[1]);
if(D == 0 && V == 0)
return;

double temp = (D*D*D*(Math.PI*2./3)-4*V)/(Math.PI*2./3);

//dritte Wurzel
double d = Math.pow(temp, 1./3);


System.out.printf("%.3f%n",d);
} while (true);
}
}