import itertools import math Q=int(input()) a=[math.log(i) for i in range(1,2*10**5)] a=list(itertools.accumulate([0]+a)) for _ in range(Q): N,M,K=map(int,input().split()) F=math.log(M)+a[N]-a[K]-a[N-K] S=math.log(N-K+1)+K*math.log(M) if F