#include <bits/stdc++.h>
int main() {
  long long int t, a, b, k;
  scanf("%lld\n", &t);
  for (int i = 0; i < t; i++) {
    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 - 1) / 2) + a));
  }
}
