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