#include <bits/stdc++.h>
#define rep(x, l, r) for(int x = l; x <= r; x++)
using namespace std;

const int dic[6][2] = {{0, 1},{0, -1}, {-1, 0}, {1, 0}, {1, -1}, {-1, 1}};
const int MAXN = 105;

int cnt, ans1, ans2;
int px[MAXN], py[MAXN], g[MAXN << 1][MAXN << 1];

void dfs(int t, int s){
	if(cnt - t + s + 1 < ans1) return;
	if(t > cnt){
		if(s > ans1) ans1 = s, ans2 = 1;
		else if(s == ans1) ans2++;
		return;
	}
	int x = px[t], y = py[t];
	int flag = 1;
	rep(i, 0, 5){
		int nx = x + dic[i][0], ny = y + dic[i][1];
		if(g[nx + 100][ny + 100]) flag = 0;
	}
	if(flag){
		g[x + 100][y + 100] = 1;
		dfs(t + 1, s + 1);
		g[x + 100][y + 100] = 0;
	}
	dfs(t + 1, s);
}

int main(){
	freopen("geometry.in", "r", stdin);
	freopen("geometry.out", "w", stdout);
	int T;
	scanf("%d", &T);
	while(T--){
		int a, b, c;
		scanf("%d%d%d", &a, &b, &c);
		cnt = 0;
		rep(i, 1 - 2 * a, 2 * a - 1){
			rep(j, 1 - 2 * b, 2 * b - 1){
				if(i + j < 1 - 2 * c || i + j > 2 * c - 1 
				|| i % 2 == 0 && j % 2 == 0) continue;
				cnt++;
				px[cnt] = i;
				py[cnt] = j;
			}
		}
		ans1 = ans2 = 0;
		dfs(1, 0);
		printf("%d %d\n", ans1, ans2);
	}
	return 0;
}
