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