#include <bits/stdc++.h>
using namespace std;
long long z, mn, mx, sum, ans, k, pos, pos1, r, xx, yy, zz, n, m, x, y;
vector<int> v;
bool OK[1000002], KO[1000002], zoom;
int b[100003], c[100002];
map<char, int> mp, mr;
set<int> st;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> x >> y >> k;
    cout << ((k + 1) / 2 * x) - (k / 2 * y) << "\n";
  }
}
