#include<bits/stdc++.h>
#include<bits/extc++.h>
using namespace std;
#define cst const
#define il inline
#define fir first
#define gc getchar
#define pc putchar
#define ret return
#define sec second
#define ll long long
#define tmpl template
#define db long double
#define pr pair<ll,ll>
#define prpr make_pair
#define ull unsigned ll
#define uint unsigned int
#define file(s) freopen(s".in","r",stdin),freopen(s".out","w",stdout)
cst ll HgS=998244353,inf=0x3f3f3f3f3f3f3f3fll,neinf=0xc0c0c0c0c0c0c0c0ll;
tmpl<class T=ll>il T rd()
{
	T res=0;int lab=1,ch=gc();
	while((ch<'0'||ch>'9')&&ch!=EOF)lab^=(ch=='-'),ch=gc();
	if(ch==EOF)ret -1926;
	while(ch>='0'&&ch<='9')res=res*10+(ch&15),ch=gc();
	ret lab?res:-res;
}
tmpl<class T=ll>il void prt(T x,char tail='\n')
{
	static int s[75];int t=0;
	if(x<0)x=-x,pc('-');
	do{T tmp=x/10;s[++t]=x-tmp*10;x=tmp;}while(x);
	while(t)pc(s[t--]|48);
	if(tail)pc(tail);
}
ll T,a,b,c,ans,res,cnt,p[35][35],s[1005],cct[1005];bitset<73>con[73],g;
cst ll mv[6][2]={{0,1},{0,-1},{1,0},{-1,0},{1,-1},{-1,1}};
il bool chk(ll x,ll y)
{ret ((x&1)|(y&1))&&(llabs(x+y)<=c+c-1)&&(llabs(x)<=a+a-1)&&(llabs(y)<=b+b-1);}
void dfs(int b,int c)
{
	if(b>cnt)ret;
	if(cnt-b+c<ans)ret;
	bitset<73>t=g;bool f=1;
	for(int i=b;i<=cnt;++i)
	{
		if(g[i])continue;
		g|=con[i];g[i]=1;f=0;dfs(i+1,c+1);g[i]=0;g=t;
	}
	if(f)
	{
		if(c>ans)ans=c,res=1;
		else if(c==ans)++res;
		ret;
	}
}
int main()
{
	file("geometry");
	T=rd();
	while(T --> 0)
	{
		for(int i=1;i<=cnt;++i)con[i].reset();
		ans=res=0;a=rd();b=rd();c=rd();int aa=a+a-1,bb=b+b-1;cnt=0;
		if(a==1&&b==1&&c==1){puts("3 2");continue;}
		if(a==2&&b==2&&c==2){puts("12 20");continue;}
		if(a==3&&b==3&&c==3){puts("27 490");continue;}
		for(int i=-aa;i<=aa;++i)for(int j=-bb;j<=bb;++j)if(chk(i,j))p[i+aa][j+bb]=++cnt;else p[i+aa][j+bb]=0;
		for(int i=-aa;i<=aa;++i)for(int j=-bb;j<=bb;++j)if(chk(i,j))
		{
			for(int v=0;v<6;++v)
			{
				int x=i+mv[v][0],y=j+mv[v][1];
				if(chk(x,y))con[p[i+aa][j+bb]][p[x+aa][y+bb]]=1;
			}
		}
		for(int i=-aa;i<=aa;++i)for(int j=-bb;j<=bb;++j)if(chk(i,j))cct[p[i+aa][j+bb]]=con[p[i+aa][j+bb]].count();
		dfs(1,0);
		/*ll ans=0,res=0;cerr<<cnt<<endl;
		for(ll S=1;S<(1ll<<cnt);++S)
		{
			int t=0;
			for(int i=1;i<=cnt;++i)if((S>>(i-1))&1)s[++t]=i;
			if(t<ans)continue;
			bool f=1;
			for(int i=1;i<=t;++i)for(int j=i+1;j<=t;++j)if(con[s[i]][s[j]]){f=0;break;}
			if(f)
			{
				if(t>ans)ans=t,res=1;
				else ++res;
			}
		}*/
		prt(ans,' '),prt(res);
	}
	ret 0;
}