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

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

J. Wedding

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

• B. Bitsorting
• C. Cubes
• D. Factorial
• E. Lights
• F. Parliament
• G. Strange Numbers
• H. Two Captains
• I. Boundary Troops
• J. Wedding

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

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

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

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

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