#include <bits/stdc++.h>
using namespace std;
void work() {
  long long a, b, k;
  cin >> a >> b >> k;
  cout << (a - b) * (k / 2) + (k % 2 == 1 ? a : 0) << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    work();
  }
  return 0;
}
