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