#include <cstdio>

int main()
{
	int ts, n, a, d;
	int sum;
	scanf("%d", &ts);
	while (ts--){
		scanf("%d%d%d", &n, &a, &d);
		sum = n * (n - 1) / 2 * d + n * a;
		printf("%d\n", sum);
	}
	return 0;
}
