// Arup Guha
// 9/7/2013
// Solution to UCF JV Practice Problem H: Moore's Law

/*** The key is setting up the equation f(x) = x + N/(2^(x/1.5), which represents
 *   the number of years the computation will get done if we wait x years and it
 *   would have taken N originally. To minimize the function, take its derivative
 *   and solve for 0. The exception is when the minimum occurs when x < 0. It's
 *   impossible for us to wait negative time. In this instance, the answer is N.
 ***/

import java.util.*;

public class h {

	final public static double BASE = Math.pow(.5, 1/1.5);

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int numCases = stdin.nextInt();

		// Process each case.
		for (int loop=0; loop<numCases; loop++) {
			int n = stdin.nextInt();

			// Important number in the derivative of the function described above.
			double factor = -1.0/n/Math.log(BASE);
			double x = Math.log(factor)/Math.log(BASE);

			// Solve accordingly.
			if (x >= 0)
				System.out.printf("%.6f\n",f(x,n));
			else
				System.out.printf("%.6f\n",(double)n);
		}
	}

	// Given a current computer task of n years and a wait if x years,
	// this returns the amount of time it would take for the task to be complete.
	public static double f(double x, int n) {
		return x + n/(Math.pow(2, x/1.5));
	}
}