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