// Arup Guha
// 3/12/2019
// Solution to 2019 UCF HS Contest Problem: Track

import java.util.*;

public class track {

	public static void main(String[] args) {
		
		Scanner stdin = new Scanner(System.in);
		int numCases = stdin.nextInt();
		
		// Process each case.
		for (int loop=1; loop<=numCases; loop++) {
			
			// Get input.
			double w1 = stdin.nextDouble();
			double w2 = stdin.nextDouble();
			double w3 = stdin.nextDouble();
			double len = stdin.nextDouble();
			
			// Set initial result based on top left corner. (Line through two inner corners to top left.)
			double x = w1*w2/len;
			double a = x + w2;
			double b = w1 + len;
			double res = Math.sqrt(a*a+b*b);
			
			// Check bottom right corner and take smaller result. (Line through two inner corners to bottom right.)
			double y = w2*w3/len;
			double c = len+w3;
			double d = w2+y;
			res = Math.min(res, Math.sqrt(c*c+d*d));
			
			// Through some calculus and trig, we find that the angle from the top left going down
			// that minimizes the corner length line is as follows. Calc and picture included at end of soln.
			double tantheta = Math.cbrt(w1/w2);
			x = w1/tantheta;
			y = w2*tantheta;
	
			// Relevant if this minimum hits the vertical side.
			if (len > y) {
				double s1 = w2+x;
				double s2 = w1+y;
				res = Math.min(res, Math.sqrt(s1*s1+s2*s2)); 
			}
			
			// Do the same thing in the other corner.
			tantheta = Math.cbrt(w3/w2);
			x = w3/tantheta;
			y = w2*tantheta;
			
			// Same deal here.
			if (len > y) {
				double s1 = w2+x;
				double s2 = w3+y;
				res = Math.min(res, Math.sqrt(s1*s1+s2*s2));
			}
			
			// Ta da!
			System.out.printf("Track Blueprint #%d: %.7f\n", loop, res);
		}
	}
}

/*** Set up for calculus. I'll use the bottom left corner treating w3 as +y-axis and w2 as +x-axis
     Let the * be the point (w2, w3). Let T be the angle shown. All three triangles in the picture
	 are similar right triangles. w2 is the width of the rectangle and w3 is its height.
	 
	 |\
	 | \
	 |  \ A
         | T \
	 |----*
	 | w2 |\
      w3 |    | \ B
	 |    | T\
	 ----------
	 
	 We aim to minimize the hypotenuse of the large triangle. This hypotenuse has length A+B,
	 where A is the hypotenuse of the top small triangle and B is the hypotenuse of the bottom
	 small triangle. So, we have
	 
	 cos T = w2/A --> A = w2sec(T)  sin T = w3/B --> B = w3csc(T)
	 
	 This means that A + B = f(T) = w2sec(T) + w3csc(T)
	 
	 We minimize this function of angle T by taking the derivative of the function:
	 
	 f'(T) = w2sec(T)tan(T) - w3csc(T)cot(T)
	 
	 Rewrite this function with a common denominator of cos^2*sin^2 (convert to all cos, sin):
	 
	 f'(T) = (w2(sin^3(T)) - w3(cos^3(T))/(sin^2(T)*cos^2(T))
	 
	 We know the angle we care about is > 0 deg and < 90 deg, so we can ignore the denominator.
	 
	 Set the numerator to 0 so we get: 
	 
	 (w2(sin^3(T)) - w3(cos^3(T)) = 0
	 w2(sin^3(T)) = w3(cos^3(T)
	 sin^3(T)/cos^3(T) = w3/w2
	 tan^3(T) = w3/w2
	 tan(T) = cbrt(w3/w2)
	 
	 We never actually need T, so we can just use tan(T) to calculate the minimum value of A+B.
	 
***/
