// Danny Wasserman
// 7/26/2011
// Solution to BHCSI Contest Problem: Gasoline.

import java.io.*;
import java.util.*;

public class gasoline
{
	public static void main(String[] args) throws IOException
	{
		Scanner in = new Scanner(new File("gasoline.in"));
		//Read in the number of test cases.
		int cases = in.nextInt();
		//Run through all the test cases
		for(int tc = 1; tc <= cases; tc++)
		{
			//Read in the radius of the tank
			double r = in.nextDouble();
			//Read in the miles per gallon of the car
			double mpg = in.nextDouble();
			
			//Calculate the number of litres the car holds,
			// (4/3)* pi * r^3 = cm^3 of the tank, 1000 cm^3 in a litre
			double litres = Math.pow(r,3.0) * Math.PI * (4.0 / 3.0) / 1000.0;
			//Calculate the number of gallons the tank holds (litres / 3.785).
			double gallons = litres / 3.785;
			
			//Calculate the number of miles that can be traveled with one full tank of gas (gallons * mpg).
			double miles = gallons * mpg;
			
			//Round answer
			int roundedMiles = (int) Math.round(miles);
			
			//print out the answer
			System.out.println("Car #" + tc + ": The car can travel up to " + roundedMiles + " miles.");
		}
	}
}