#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int from, to, dist;
  Edge(int u, int v, int d) : from(u), to(v), dist(d) {}
};
int x;
long long a, b, k, ans;
int main() {
  cin >> x;
  for (int i = 1; i <= x; i++) {
    cin >> a >> b >> k;
    long long tmp = a - b;
    if (k % 2 == 0)
      ans = tmp * (k / 2);
    else
      ans = tmp * (k / 2) + a;
    cout << ans << endl;
  }
  return 0;
}
