#include <bits/stdc++.h>
using namespace std;
struct pairs {
  int prices;
  int quality;
};
bool compare(pairs x, pairs y) { return x.prices < y.prices; };
int main() {
  int t;
  cin >> t;
  long long a, b, k;
  for (int i = 0; i < t; i++) {
    cin >> a >> b >> k;
    if (k % 2 == 0) {
      cout << k / 2 * (a - b) << endl;
    } else
      cout << k / 2 * (a - b) + a << endl;
  }
  return 0;
}
