#include <bits/stdc++.h>
int main() {
  int t;
  scanf("%d", &t);
  while (t > 0) {
    long long int a, b, k, h = 0;
    scanf("%lld%lld%lld", &a, &b, &k);
    h = k / 2;
    b = b * h;
    if (k % 2 != 0) h++;
    a = a * h;
    printf("%lld\n", a - b);
    t--;
  }
  return 0;
}
