#include using namespace std; typedef long long ll; typedef long double ld; int main() { #ifdef ONPC ifstream cin("a.in"); ofstream cout("a.out"); #endif // ONPC ios::sync_with_stdio(0); int t; cin >> t; for (int i = 0; i < t; i++){ ll x, y, n; cin >> x >> y >> n; if (n & 1) x *= 2; if (x < y) swap(x, y); cout << x / y << '\n'; } }