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