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