import math Q=int(input()) LOG=[0]+[math.log(i) for i in range(1,10**5+2)] LOGSUM=[0]*(10**5+2) for i in range(1,10**5+2): LOGSUM[i]=LOGSUM[i-1]+LOG[i] for i in range(Q): N,M,K=map(int,input().split()) if LOGSUM[N]-LOGSUM[K]-LOGSUM[N-K]+math.log(M)