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