#include <bits/stdc++.h>
#define ll long long int
using namespace std;

void mainSolve()
{
    int n, m, x;
    cin >> n >> m >> x;
    if (x == m)
    {
        cout << 0 << endl;
        return;
    }
    int sum = n * x;
    int ans = sum / (x + 1);
    cout << ans << endl;
}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int t;
    cin >> t;
    while (t--)
    {
        mainSolve();
    }
    return 0;
}