Snowman

Finally the time of the year has come where children can build snowmans. The children have collected some snow and ask you how big the snowman is going to be.

Assume that the snowman will consist of three spheres stacked on top of each other. The lower two spheres are of equal size, the smaller sphere (used for the head) will have a radius of 25 percent of the radius of the larger spheres.

Input
The first line of the input contains a number **t** ≤ 100, which indicates the number of test cases to follow. Each test case consists of a line with one integer **a** ≤ 500000, the amount of snow in cm3.

Output
For each test case, print a line with the height of the snowman in cm. Round this number down to the next smaller integer.

**Sample Input**
2 100 500000

**Sample Output**
10 175

Reference
[]

Source Code code format="java5" public class Snowman { public static void main(String[] args) { int n = 100; System.out.println(getHeight(n));

n = 500000; System.out.println(getHeight(n)); }

public static int getHeight(int amount) { double radius = getRadius(amount * 64 / 129); return (int)(radius * 4.5); }

private static double getRadius(double sphere) { return Math.cbrt(sphere * 3 / 4 /Math.PI); } } code

Comment