HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Exhaustive search & Backtracking > problem:


50250 - The Knight

Guest
• Discussion of problem (1)

Section problems

• 50367 - Bar Codes
• 50250 - The Knight
• 50707 - Rebus
• 50265 - Liars and Knights
• 51071 - Phalanx-2
• 50715 - Zero Sum
• 50711 - Snail Trails
• 50472 - Minimum Sum Triangle
• 50306 - Beautiful Numbers
• 50716 - All Palindromes

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

Chess Association has decided to equip all of its employees with telephone numbers, which would be integrated to the speed-dial button progress of the knight. For example, the progress of the knight is dialed 340-4927. This phone number can not start with either a 0 or a figure 8.

The phone's keypad looks like this:
  789
  456
  123
   0
Write a program that determines the quantity of telephone numbers length N , integrated in the speed-dial knight.

Input
Input contains an integer N (1 ≤ N ≤ 50).
Output
Display the desired number of telephone numbers.

Input
2
Output
16

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

www.contester.ru