/* package codechef; // don’t place package name! */
import java.util.;
import java.lang.;
import java.io.*;
/* Name of the class has to be “Main” only if the class is public. */
class Codechef
{
public static int totalCost(){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int X = sc.nextInt();
int perimeter = (2 * M) + (2 * N);
int totalCostOfWire = perimeter * X;
return totalCostOfWire;
}
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
try{
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for(int i = 0; i < T; i++){
System.out.println(totalCost());
}
}
catch(Exception e){
return;
}
}
}