eolymp
bolt
Try our new interface for solving problems
Problems

Marks Distribution

Marks Distribution

In an examination period one student appeared in \textbf{n} subjects and has got total \textbf{t} marks. He has passed in all the \textbf{n} subjects where minimum mark for passing in each subject is \textbf{p}. You have to calculate the number of ways the student can get the marks. For example, if \textbf{n = 3}, \textbf{t = 34} and \textbf{p = 10} then the marks in the three subject could be as follows. So the student can get marks in \textbf{15} ways. \InputFile The first line contains the number of test cases. Each of the next lines is a test case that contains three positive integers denoting \textbf{n}, \textbf{t} and \textbf{p} respectively. The values of \textbf{n}, \textbf{t} and \textbf{p} will be at most \textbf{70}. \OutputFile For each test case print in a separate line the number of ways the student can get the marks. You may assume that the final answer will fit in a signed \textbf{32}-bit integer.
Time limit 1 second
Memory limit 64 MiB
Input example #1
2
3 34 10
3 34 10
Output example #1
15
15