ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Kovrov IT > задача:


2007.J. 50275 - Wedding

Гость
• Обсуждение задачи (1)

Задачи сборника

• 2007.D. 50271 - Factorial
• 2007.K. 50276 - Nice Floor
• 2007.A. 50671 - Phalanx
• 2007.B. 50270 - Bitsorting
• 2007.E. 50663 - Lights
• 2007.G. 50272 - Strange Numbers
• 2007.H. 50273 - Two Captains
• 2007.I. 50274 - Boundary Troops
• 2007.J. 50275 - Wedding
• 2007.F. 50690 - Parliament
• 2010.C. 50255 - Bishops

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Автор: Павел Кузнецов, ПГУ. Сложность Гамма

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