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