from sys import stdin input = stdin.readline for _ in range(int(input())): N, M, K = map(int, input().split()) ans1, ans2 = 0, 0 cnt = (K+M-1)//M ans1 = (N-cnt)/N/M now = 1 cnt = K-(N-1)*M-1 ans2 = (M-1)/M if 1 <= cnt: ans2 *= (M-1-cnt)/(M-1) print(ans1+ans2)