How Probable?

0

0 votes
Problem

Srinivass and Jinu plays a game. Srinivass has N cards. He labels them from 1 to N. Jinu now picks one card each (blind-folded) M times. Srinivass replaces a card identical to Jinu’s pick after every pick.

Now Srinivass gives an integer S. Jinu has to find the probability of getting S as the sum of values of cards he had picked. Jinu never gets his answers wrong. Predict Jinu’s answer.

Since Srinivass hates all numbers except whole numbers, output floor(answer*100000).

Where, answer = Probability (Sum of M cards picked = S)

Note: floor(x) is same as greatest integer function, i.e. the highest integer less than or equal to x.


Constraints
1<=N, M<=75
1<=S<=5625

INPUT
Input contains 3 integers N, M, S.

OUTPUT
Output Jinu’s answer.

Sample Test case #1
Input
3 2 3
Output
22222
Explanation: All possible picks : (1,1), (1,2), (1,3), (2,1), (2,2), (2,3), (3,1), (3,2), (3,3)
Possible sums: 2 (x1), 3(x2), 4(x3), 5(x2), 6(x1)
P(S=3) = 2/9, floor( 100000 * 2/9) = 22222

Sample Test Case #2
Input
3 5 1
Output
0
Explanation: No way to obtain S=1

Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?