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