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