#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, k;
  int t;
  cin >> t;
  while (t--) {
    cin >> a >> b >> k;
    if (k & 1) {
      cout << (a - b) * (k / 2) + a << endl;
    } else
      cout << (a - b) * (k / 2) << endl;
  }
}
