#include #include using namespace std; using ll = long long; #define rep(i, s, t) for (ll i = s; i < (ll)(t); i++) #define all(x) begin(x), end(x) template bool chmin(T& x, T y) { return x > y ? (x = y, true) : false; } template bool chmax(T& x, T y) { return x < y ? (x = y, true) : false; } void solve() { ll n, m, k; cin >> n >> m >> k; ll dv = (k + m - 1) / m; if (dv >= n) { ll d = k - (n - 1) * m; cout << (double)(m - d) / m << '\n'; } else { double d = 0; d += (double)(n - dv) / n; d += ((double)dv / n) * (m - 1) / m; cout << d << '\n'; } } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(15); int t = 1; cin >> t; while (t--) solve(); }