#include using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int T; cin >> T; cout << fixed << setprecision(15); while (T--) { ll N, M, K; cin >> N >> M >> K; long double ans; ll border = (N - 1) * M + 1; if (K <= border) { ll t = (K + M - 1) / M; // ceil(K / M) ans = 1.0L - (long double)t / ((long double)N * M); } else { ans = (long double)(N * M - K) / M; } cout << ans << '\n'; } return 0; }