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