#include<bits/stdc++.h>
using namespace std;
#define int long long
int read(){
	int w=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9')f=c=='-'?-f:f,c=getchar();
	while(c>='0'&&c<='9')w=w*10+c-'0',c=getchar();
	return w*f;
}
struct node{
    int x,y;
    node(int X=0,int Y=0){x=X,y=Y;}
    bool operator<(const node&o)const{return x==o.x?y<o.y:x<o.x;}
};
int T,n,maxn,cnt;
vector<node>v;
map<node,bool>mp;
bool check(node x){
    if(mp.count(node(x.x,x.y+1)))return 0;
    if(mp.count(node(x.x,x.y-1)))return 0;
    if(mp.count(node(x.x-1,x.y)))return 0;
    if(mp.count(node(x.x+1,x.y)))return 0;
    if(mp.count(node(x.x-1,x.y+1)))return 0;
    if(mp.count(node(x.x+1,x.y-1)))return 0;
    return 1;
}
void dfs(int u,int now){
    if(u==n){
        if(now>maxn)maxn=now,cnt=1;
        else if(now==maxn)cnt++;
        return;
    }
    dfs(u+1,now);
    if(check(v[u])){
        mp[v[u]]=1;
        dfs(u+1,now+1);
    }
}
signed main(){
    freopen("geometry.in","r",stdin);
    freopen("geometry.out","w",stdout);
    T=read();
    while(T--){
        int a=read(),b=read(),c=read();
        maxn=cnt=0,mp.clear(),v.clear();
        for(int i=-a*2+1;i<=a*2-1;i++)
            for(int j=-b*2+1;j<=b*2-1;j++){
                if(!(-c*2+1<=i+j&&i+j<=c*2-1)||((i+100)%2==0&&(j+100)%2==0))continue;
                v.push_back(node(i,j));
            }
        n=v.size();
        dfs(0,0);
        printf("%lld %lld\n",maxn,cnt);
    }
	return 0;
}