HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN303 2013-15 Questions > problem:


14-Fall2-30. 50490 - Across the River

CEN303 2013-15 Questions

Start: Dec.15.2013 at 02:00:00 PM
Finish: Dec.15.2013 at 07:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 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 - Parking Buses
• 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

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.
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