for t in[0]*int(input()):N,M,K=map(int,input().split());print([1-((K+M-1)//M)/(N*M),(N*M-K)/M][K>(N-1)*M+1])