HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Problems from Olympiads.ru > problem:


235. 50250 - The Knight

Guest
• Discussion of problem (1)

Volume problems

• 138. 50732 - Sorting
• 147. 50251 - Symmetric matrix
• 213. 50769 - Arithmetic expression
• 217. 50253 - Timer
• 133. 50239 - Eating cheese
• 159. 50668 - Triangle
• 206. 50252 - Birthday
• 234. 50249 - Ladders
• 235. 50250 - The Knight
• 272. 50707 - Rebus
• 240. 50247 - Missing numbers
• 275. 50691 - The traveling salesma...

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