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