#include<bits/stdc++.h>
using namespace std;
int v[6][2]={
    {0,1},
    {0,-1},
    {1,0},
    {-1,0},
    {1,-1},
    {-1,1}
};
const int _=100;
int ans=0,anss=0,indec=0,col[201][201];
int X[201],Y[201],a,b,T,c;
int outt(int x,int y){
    if(x>2*a-1||x<-2*a+1)return 0;
    if(y>2*b-1||y<-2*b+1)return 0;
    if(x+y>2*c-1||x+y<-2*c+1)return 0;
    return 1;
}
int ok(int x,int y){
    for(int i=0;i<6;i++){
        if(col[x+v[i][0]+_][y+v[i][1]+_])return 0;
    }
    if(x%2==0&&y%2==0)return 0;
    return 1;
}
void check(int cnt){
    if(cnt>ans){ans=cnt,anss=0;}
    else if(cnt==ans)anss++;
}
void dfs(int id,int cnt){
    check(cnt);
    int x=X[id],y=Y[id];
    if(id>indec)return;
    if(!outt(x,y))return;
    if(ok(x,y)){
        col[x+_][y+_]=1;
        dfs(id+1,cnt+1);
    }
    else dfs(id+1,cnt);
}
void solve(){
    scanf("%d%d%d",&a,&b,&c);
    indec=0;
    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==0&&j%2==0)continue;
            if(!outt(i,j))continue;
            ++indec;
            X[indec]=i,Y[indec]=j;
        }
    }
    dfs(1-2*a,1-2*b);
    printf("%d %d\n",ans,anss);
}
int main(){
    freopen("geometry.in","r",stdin);
    freopen("geometry.out","w",stdout);
    scanf("%d",&T);
    while(T--){
        solve();
    }
}
