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