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