#include <bits/stdc++.h>
int main() {
  int ntest;
  scanf("%d", &ntest);
  while (ntest-- > 0) {
    long long int a, b, k;
    scanf("%lld %lld %lld", &a, &b, &k);
    long long int result;
    if (k % 2 == 0) {
      result = (k / 2) * a - (k / 2) * b;
    } else {
      result = (k / 2 + 1) * a - (k / 2) * b;
    }
    printf("%lld\n", result);
  }
  return 0;
}
