// Arup Guha
// Solution to 2011 NY Regional Problem B: The Rascal Triangle
// 10/22/2012

import java.util.*;

public class b {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int numC = stdin.nextInt();

		// Process all cases.
		for (int loop=0; loop<numC; loop++) {

			// Read in case.
			int caseNum = stdin.nextInt();
			int n = stdin.nextInt();
			int m = stdin.nextInt();

            // Nice closed-form solution =) Can be proved via induction.
			System.out.println(caseNum+" "+(1+m*(n-m)));
		}
	}
}
