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