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