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