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