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

Турниры > CEN303 2013-15 Questions > задача:


14-Fall2-30. 50490 - Across the River

CEN303 2013-15 Questions

Старт: 15.дек.2013 в 14:00:00
Финиш: 15.дек.2013 в 19:00:00
Турнир завершён!
• Турнирная таблица

Гость
• Вопросы к жюри (1)

Задачи турнира

• 14-Fall1-10. 50740 - Service Time - 1
• 14-Fall1-20. 50750 - Service Time - 2
• 14-Fall1-30. 50771 - BST Level Sum
• 14-Fall1-40. 50683 - Te Parkojme A...
• 14-Fall1-50. 50770 - Average Depth
• 14-Fall1-60. 50784 - Top Growing C...
• 14-Fall2-10. 50751 - The biggest Mi...
• 14-Fall2-20. 50794 - Writing Files Int...
• 14-Fall2-30. 50490 - Across the...
• 14-Fall2-40. 50772 - The Path of a N...
• 14-Fall2-50. 50681 - Center of a Series
• 14-FallResit-10. 50525 - Ordering Pizza
• 14-FallResit-20. 50488 - Connecting...
• 15FE-01. 50851 - Repeated Numbers
• 15FE-01. 50838 - Balanced Numbers
• 15FE-04. 50997 - Dynamic Knights
• 15HW-10. 50826 - Olive Containers

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

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

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Ibrahim Mesecan.

Across the River

There are n people escaping from the war. They have to cross over a river. There is a boat which can carry k people. After crossing the river, they can pull back the boat using a string. To provide security on both sides of the river, certain people cannot leave together. At least one soldier must exist on either side of the river.

Question: Write a program that is going to read the people information and decide by how many different ways all the people can cross the river.

Input specification: There are 3 integers in the first line:

  • n: the number of people
  • m: the number of soldiers where m is between 2 and 4
  • k: the number of people the boat can carry
where 0 < n < 8, 1 < m ≤ 4, and 2 ≤ k ≤ 6, and k is a multiple of (m+n) The following line lists the name of n people separated by spaces. The last line contains the name of the soldiers. Names contain only 26 English uppercase or lowercase characters.

Output specification
Show one integer: the number of different ways all the people can cross the river.

Sample Input I
2 2 2
Andi Anisa
Ani Geri
Sample Output I
4

Explanation: There are 4 possible ways that they can use the boat and cross over a river. The soldiers below are underlined.

  1. [Andi Ani] - [Anisa Geri]
  2. [Andi Geri] - [Anisa Ani]
  3. [Anisa Ani] - [Andi Geri]
  4. [Anisa Geri] - [Andi Ani]


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

www.contester.ru