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