// Alex Coleman
// 2/21/2017
// Solution to 2017 FHSPS Playoff Questions: Igloo

import java.util.Scanner;

/*
2/3 pi * x^3 - 2/3 * pi * (x-t)^3 = v
	
2/3 pi * (x^3 - (x-t)^3) = v
x^3 - (x-t)^3 = v / (2/3 * pi)
x^3 - (-t^3+3t^2x-3tx^2+x^3) = v / (2/3 * pi)
3tx^2 - 3t^2 * x + t^3 = v / (2/3 * pi)
(3t)x^2 + (-3t^2) * x + (t^3 - v / (2/3 * pi)) = 0

*/

public class igloo_coleman {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int T = in.nextInt();
		
		// Process each case.
		while(T --> 0) {
			
			// Set up and solve quadratic described above.
			double v = in.nextInt(), t = in.nextInt();
			double a = 3.0*t, b = -3.0*t*t, c = t*t*t-v/(2/3.0 * Math.PI);
			System.out.printf("%.3f\n", maxQuad(a,b,c));
		}
	}
	
	// Returns the larger root of this quadratic.
	static double maxQuad(double a, double b, double c) {
		double x1 = (-b+Math.sqrt(b*b-4*a*c))/(2.0*a);
		double x2 = (-b-Math.sqrt(b*b-4*a*c))/(2.0*a);
		return Math.max(x1, x2);
	}
}
