
import java.util.Scanner;

public class Rectangle1 {
	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();
			
			double perimeter = (length + width) * 2.0;
			double area = length * width;
			
			System.out.printf("%.2f %.2f\n", perimeter, area);
		}
	}
}


