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

Разделы > Сортировка и последовательности > задача:


Wedding

Задачи раздела

• Bitsorting
• Wedding
• Two Captains
• Возрастающая последовательность
• Выражение
• День рождения Иванова
• Наибольшее произведение
• Наибольшее произведение (2)
• Наибольшее число
• Сортировка

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

Если у вас есть предложения или пожелания по работе 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