#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=144;
int T,cnt,a,b,c,Map[100][100],ans1,ans2;
int dx[6]={0,0,1,-1,1,-1};
int dy[6]={1,-1,0,0,-1,1};
bitset<N>to[N],E;
map<ll,int> dp[N];
inline ll calc(bitset<N>vis){
	ll s=0;
	for (int i=21;i<=cnt;i++)
		if (vis[i])s+=1ll<<i;
	return s;
}
void dfs(int x,bitset<N> vis,int num){
	if (num>ans1)ans1=num,ans2=0;
	if (num==ans1){
		ans2++;
	}
	int t=0;
	if (x>20&&dp[x].count(calc(vis))&&num+dp[x][calc(vis)]<ans1)return;
	for (int i=x;i<=cnt;i++)
		if (!vis[i]){
			dfs(i+1,vis|to[i],num+1);
			if (x>20)dp[x][calc(vis)]=max(dp[x][calc(vis)],dp[i+1][calc(vis|to[i])]+1);
		}
}
int main(){
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	scanf("%d",&T);
	while (T--){
		memset(Map,0,sizeof Map);
		cnt=0;
		scanf("%d%d%d",&a,&b,&c);
		for (int i=-2*a+1;i<=2*a-1;i++)
			for (int j=-2*b+1;j<=2*b-1;j++)
				if (((i%2)||(j%2))&&(i+j>=-2*c+1)&&(i+j<=2*c-1))Map[i+20][j+20]=++cnt,to[cnt].reset();
		for (int i=-2*a+1;i<=2*a-1;i++)
			for (int j=-2*b+1;j<=2*b-1;j++)if (Map[i+20][j+20]){
				to[Map[i+20][j+20]][Map[i+20][j+20]]=1;
				for (int k=0;k<6;k++){
					int tx=i+dx[k],ty=j+dy[k];
					if (Map[tx+20][ty+20])to[Map[i+20][j+20]][Map[tx+20][ty+20]]=1;
				}
			}
		dfs(1,E,0);
		printf("%d %d\n",ans1,ans2);
	}
}
