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