#include <bits/stdc++.h>
using namespace std;
long long n, x, y, k, ans;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    ans = 0;
    cin >> x >> y >> k;
    cout << (k + 1) / 2 * x - k / 2 * y << endl;
  }
  return 0;
}
