#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e2 + 10;
long long a, b, k;
int main() {
  int cas;
  while (~scanf("%d", &cas)) {
    while (cas--) {
      scanf("%I64d %I64d %I64d", &a, &b, &k);
      if (k & 1)
        printf("%I64d\n", (k + 1) / 2 * a - k / 2 * b);
      else
        printf("%I64d\n", k / 2 * a - k / 2 * b);
    }
  }
  return 0;
}
