You are not logged in. Please login at www.codechef.com to post your questions!

×

# [ Closed ] Codeforces The World is a Theatre

 0 Problem Statement : Click here. I have approached at this formula for this question. Assume C[n][r] = n!/(n-r)!*(r!) ans = c[n][4] * c[m][1] * c[n+m-5][t-5]; <-- this is the formula i've got. Please correct me, Where I've gone wrong? asked 30 Jun '15, 18:29 78●7●27 accept rate: 0%

 1 Your formula will lead to repeated cases. Example there are 4 boys and 3 girls and t = 6 then your answer is c[4][4] * c[3][1] * c[2][1] = 6 but answer is 3 because there are only 4 boys so each group needs to have all the boys plus 2 more girls for which there are C[3][2] ways = 3. What is happening is that once you fix certain girls/boys in the compulsory slot call them X and then you pick another set of boys/girls in the non compulsory slot, call them Y. Now it is possible that in some other group, you have already counted this group by including some of Y in the compulsory slots and some of X in the non compulsory slot. Since t is small, I would suggest you go by the answer as - ans = C[n][4] * C[m][t-4] + C[n][5] * C[m][t-5] + ..... C[n][t-1] * C[m][1] Depending on n and m, there will be slight modifications in this, but you get the idea. answered 30 Jun '15, 19:23 1.0k●6●11●22 accept rate: 16% Thanks! :) (30 Jun '15, 19:47) No problem ! (30 Jun '15, 19:51)
 0 I think c[n][4]*c[m][1] is enough. answered 30 Jun '15, 19:13 4★pallesai 176●8●31 accept rate: 17% please read the question carefully and check before answering here . (30 Jun '15, 19:25)
 toggle preview community wiki:
Preview

### Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×3,828
×1,191
×900
×688
×281

question asked: 30 Jun '15, 18:29

question was seen: 1,320 times

last updated: 30 Jun '15, 19:51