#include <bits/stdc++.h>
using namespace std;
long long kq(long long a, long long b, long long c) {
  long long s = 0;
  if (c % 2 == 1) s = a;
  c /= 2;
  s += (a - b) * c;
  return s;
}
int main() {
  long long t, a, b, c;
  long long s;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c;
    cout << kq(a, b, c) << endl;
  }
  return 0;
}
