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