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