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