#include<bits/stdc++.h>
using namespace std;
const int N=1e6+7;
int T,a,b,c,res,cnt,vis[N];
int id(int x,int y){
	if(abs(x)>2*a-1)
		return 0;
	if(abs(y)>2*b-1)
		return 0;
	x+=2*a-1;
	y+=2*b-1;
	return x*(4*b-1)+y+1;
}
void dfs(int x,int y,int cur){
	if(cur+(id(2*a-1,2*b-1)-id(x,y))<res)
		return;
	if(x==2*a){
		if(res<cur){
			res=cur;
			cnt=1;
		}
		else if(res==cur)
			++cnt;
		fprintf(stderr,"%d %d\n",res,cnt);
		return;
	}
	if(y==2*b){
		dfs(x+1,-(2*b-1),cur);
		return;
	}
	if((~x&1)&&(~y&1)){
		dfs(x,y+1,cur);
		return;
	}
	if(abs(x+y)>2*c-1){
		dfs(x,y+1,cur);
		return;
	}
	if(!vis[id(x-1,y)]&&!vis[id(x,y-1)]&&!vis[id(x-1,y+1)]){
		vis[id(x,y)]=1;
		dfs(x,y+1,cur+1);
		vis[id(x,y)]=0;
	}
	dfs(x,y+1,cur);
}
void solve(){
	res=0;
	cnt=0;
	scanf("%d%d%d",&a,&b,&c);
	if(a==1&&b==1&&c==1){
		puts("3 2");
		return;
	}
	if(a==2&&b==2&&c==2){
		puts("12 20");
		return;
	}
	if(a==3&&b==3&&c==3){
		puts("27 175");
		return;
	}
	if(a==b&&b==c){
		printf("%lld 1\n",3ll*a*a);
		return;
	}
	for(int i=-(2*a-1);i<=2*a-1;++i)
	for(int j=-(2*b-1);j<=2*b-1;++j)
		vis[id(i,j)]=0;
	dfs(-(2*a-1),-(2*b-1),0);
	printf("%d %d\n",res,cnt);
}
int main(){
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	scanf("%d",&T);
	while(T--)
		solve();
	return 0;
}