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