// Arup Guha
// 5/2/2014
// Solution to UCF HS Contest Problem: The Diagonal Crease

import java.util.*;
import java.io.*;

public class crease {

	public static void main(String[] args) throws Exception {

		Scanner fin = new Scanner(new File("crease.in"));

		// Process all cases.
		int numCases = fin.nextInt();
		for (int loop=1; loop<=numCases; loop++) {
			int a = fin.nextInt();
			int b = fin.nextInt();
			System.out.printf("Crease #%d: %.2f\n", loop, solve(Math.min(a,b), Math.max(a,b)));
		}
		fin.close();
	}

	// Pre-condition: 0 < min <= max.
	// Post-condition: Returns the length of the crease formed when folding together opposite
	//                 corners of a paper with dimensions min x max.
	public static double solve(int min, int max) {

		// Set up the line bisecting the crease, which is perpendicular to the crease.
		// This triangle, with legs a and b, is similar to the triangle formed with
		// the crease, a and a portion of b.
		return min*Math.sqrt(min*min+max*max)/max;
	}
}