public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int testCases = in.nextInt();
		
		while (testCases > 0) {
			System.out.println(totalChoc(in.nextInt(), in.nextInt(), in.nextInt()));
			testCases--;
		}

	}