main = interact $ unlines . map (show . equal_sum_sets . map read . words) . init . lines

equal_sum_sets [n,k,s] = length [()| xs <- combBy k [1..n], sum xs == s]

combBy 0 _ = [[]]
combBy _ [] = []
combBy n (x:xs) = map (x:) (combBy (n-1) xs) ++ combBy n xs