#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long r[1000], l[1000], c[1000];
  for (int i = 0; i < n; i++) {
    cin >> r[i] >> l[i] >> c[i];
  }
  for (int i = 0; i < n; i++) {
    cout << (c[i] / 2) * (r[i] - l[i]) + (c[i] % 2 * r[i]) << endl;
  }
}
