算法题:UVA 10910 - Marks Distribution (dp)2014-04-24 csdn accelerator_

In an examination one student appeared in N subjects and has got total T marks. He has passed in all the N subjects where minimum mark for passing in each subject is P. You have to calculate the number of ways the student can get the marks. For example, if N=3, T=34 andP=10 then the marks in the three subject could be as follows.

InputIn the first line of the input there will be a single positive integer K followed by K lines each containing a single test case. Each test case contains three positive integers denoting N, T and P respectively. The values of N, T and P will be at most 70. You may assume that the final answer will fit in a standard 32-bit integer.OutputFor each input, print in a line the value of F (N, T, P).