#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int z = 0; z < t; z++) {
    long long make, a, b;
    cin >> a >> b >> make;
    if (make % 2 == 0) {
      long long res = (a - b) * (make / 2);
      cout << res << endl;
      continue;
    }
    long long res = (a - b) * (make / 2) + a;
    cout << res << endl;
  }
  return 0;
}
