HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Winner's Camp > problem:


01. 50722 - Scientist's problem

Guest
• Discussion of problem (1)

Volume problems

• 51004 - Word Search Game
• 03. 50673 - DNA Testing
• 06. 50714 - The knight
• 12. 50723 - Tribonacci
• 04. 50649 - Puzzle
• 01. 50722 - Scientist's problem
• 02. 50376 - Sequences
• 05. 50713 - Castle and the girls
• 08. 50370 - Number of rectangles in ...
• 09. 50716 - All Palindromes
• 10. 50475 - Voice advertising
• 11. 50476 - Meditation
• 07. 50715 - Zero Sum

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.
Prepared by Ilir Capuni. Difficulty Beta

Scientist's problem

Shqip

Question:
A chemist is looking forward to create all possible chains of length n of atoms of Plutonium (Pu) and Lead (Pb), such that each chain that is formed cannot induce an atomic explosion. An explosion could occur if a chain contains at least two consecutive atoms of Plutonium.

For example, for n=4 some of the atomic chains that the scientist can create are:

Pb-Pb-Pu-Pb
Pb-Pb-Pb-Pb
Pu-Pb-Pb-Pu

But the following chain:

Pb-Pu-Pu-Pb

will lead to an explosion, because there are two consecutive Pu atoms.
How many "safe" chains of length n are there?

Input specification
You will be one positive integer n where 1 ≤ n ≤ 35.

Output specification
Show just one integer number: the number of safe chains.

Sample Input I   
  10
Sample Input II   
  16
Sample Output I   
  144
Sample Output II   
  2584


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

www.contester.ru