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