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