The World is a Theatre(组合数学)
There are n boys and m girls attending a theatre club. To set a play “The Big Bang Theory”, they need to choose a group containing exactly t actors containing no less than 4 boys and no less than one girl. How many ways are there to choose a group? Of course, the variants that only differ in the composition of the troupe are considered different.
Perform all calculations in the 64-bit type: long long for С/С++, int64 for Delphi and long for Java.
Input
The only line of the input data contains three integers n, m, t (4?≤?n?≤?30,?1?≤?m?≤?30,?5?≤?t?≤?n?+?m).
Output
Find the required number of ways.
Please do not use the %lld specificator to read or write 64-bit integers in С++. It is preferred to use cin, cout streams or the %I64d specificator.
Examples
Input
5 2 5
Output
10
Input
4 3 5
Output
3
挺水的這道題,但是一次做對也不是很容易。首先打表求出組合數。其次數組不要開得太小,dp[i][j],如果j>i的時候,就是0。
代碼如下:
努力加油a啊,(o)/~
總結
以上是生活随笔為你收集整理的The World is a Theatre(组合数学)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: George and Job(动态规划)
- 下一篇: Remove Extra One(思维)