HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Kovrov IT > problem:


2007.J. 50275 - Wedding

Guest
• Discussion of problem (1)

Volume problems

• 2007.B. 50270 - Bitsorting
• 2007.C. 50640 - Cubes
• 2007.D. 50271 - Factorial
• 2007.E. 50663 - Lights
• 2007.F. 50690 - Parliament
• 2007.G. 50272 - Strange Numbers
• 2007.H. 50273 - Two Captains
• 2007.I. 50274 - Boundary Troops
• 2007.J. 50275 - Wedding
• 2007.K. 50276 - Nice Floor
• 2008.A. 50672 - Math and Soldiers
• 2008.B. 50261 - Roads
• 2008.C. 50262 - Brackets
• 2008.D. 50279 - Bit Decoder
• 2008.E. 50263 - Points
• 2008.F. 50972 - Division
• 2008.G. 50264 - String Multiplication

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Автор: Павел Кузнецов, ПГУ. Difficulty Gamma

Many guests from various kingdoms were invited to a wedding of prince of Byteland and princess of Bitland. After guests sat down the tables, it turned out that N guests are not acquainted with each other. One long table was prepared for them. During the celebration, every man, sitting not at the edge, got acquainted with both neighbours - from right and from left. Two guests, sitting at the two edges, got acquainted with the only neighbour each, sitting near each of them. Enough time has passed, and the host decides to start a game for guests at that table. He knows who has got acquainted with whom, and wants to choose K guests out of N, so that, there must be M pairs of familiars among them. How many ways to do this are there?

Input
The first line contains integer numbers N, K and M (2 ≤ N ≤ 65; 2 ≤ KN; 0 ≤ MK-1).
Output
Output must contain the only number - the answer.

Input 1 Output 1
3 2 0
1
Input 2 Output 2
5 3 1
6

Для отправки решений необходимо выполнить вход.

www.contester.ru