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