
import java.util.Scanner;

public class Rectangle2 {
	public static void main(String [] args) {
		Scanner input = new Scanner(System.in);
		
		int N = input.nextInt(); input.nextLine();
		
		for (int i = 0; i < N; i++) {
			double length = input.nextDouble();
			double width = input.nextDouble();
			input.nextLine();

			System.out.printf("%.2f %.2f\n", 
				recPerimeter(length, width),
				recArea(length, width));
		}
	}
	
	public static double recPerimeter(double len, double wid) {
		return (len + wid) * 2.0;
	}
	
	public static double recArea(double len, double wid) {
		return len * wid;
	}
}


