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