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