#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int imax = 2147483647;
const int imin = -2147483647;
const long long lmax = 9223372036854775807;
const long long lmin = -9223372036854775807;
long long n, m;
string s, g = "";
bool isValid(long long x, long long y) {
  return (x >= 0 && x < n && y >= 0 && y < n);
}
long long power(long long x, long long b) {
  long long p = 1;
  while (b) {
    if (b & 1) p = (p * x) % 1000000007;
    b >>= 1;
    x = (x * x) % 1000000007;
  }
  return p % 1000000007;
}
long long solve(long long k) {}
int main() {
  long long k, a, b, x, l, h, ans;
  cin >> k;
  while (k--) {
    ans = 0;
    cin >> a >> b >> n;
    ans = (n / 2LL) * (a - b);
    if (n & 1LL) ans += a;
    cout << ans << endl;
  }
  return 0;
}
