#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <math.h>
#include <string>
using namespace std;
int main() {
int n;
scanf("%d", &n);
for (int i = 1;i <= n;++i) {
long long a, b, k, ans;
scanf("%lld %lld %lld", &a, &b, &k);
if (k % 2 == 0) {
printf("%lld\n", (a - b)*(k / 2));
}
else {
printf("%lld\n", (a - b)*((k - 1) / 2) + a);
}
}
//system("pause");
return 0;
}