HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


50275 - Wedding

Guest
• Discussion of problem (1)

Section problems

• 50280 - Division
• 50266 - Kovrov
• 50254 - Lawyers Council
• 50260 - What about judges?
• 50259 - Many-coloured roads
• 50276 - Nice Floor
• 50270 - Bitsorting
• 50272 - Strange Numbers
• 50275 - Wedding
• 50273 - Two Captains
• 50274 - Boundary Troops
• 50278 - ATM
• 50277 - Unusual Lottery
• 50283 - Tetris 3D
• 50285 - Meat store
• 50279 - Bit Decoder
• 50284 - Knights of the Rook

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