<PREV Problem:
NEXT>
Solved by 209 users: ...
UserDateAttemptTimeCMSC
abortmozga.ru06 apr 2009Ruby2800.027 
abortmozga.ru06 apr 2009Ruby2900.027 
abortmozga.ru06 apr 2009Ruby3000.027 
abortmozga.ru06 apr 2009Ruby3100.027 
abortmozga.ru06 apr 2009Ruby3200.027 
Jacob06 apr 2009Ruby600.0112 
814_Vadik15 may 2009Ruby1500.0218 
814_Vadik15 may 2009Ruby1300.0222 
814_Vadik15 may 2009Ruby1400.0222 
Vladimir_Sitnikov04 apr 2009Ruby100.0263 
stasg703 dec 2009Ruby700.0371 
LOD04 jun 2017Python400.05103 
814_Vadik15 may 2009Ruby1200.02111 
814_Vadik15 may 2009Ruby1100.02113 
bush13 jan 2013Ruby200.02115 
Kopyrin_37.508 nov 2013Ruby1100.02127 
bush13 jan 2013Ruby100.02138 
ethanhunt25 may 2011Python700.07144 
ethanhunt25 may 2011Python800.06147 
ethanhunt25 may 2011Python600.06148 
asp09 jun 2009Ruby100.03150 
ethanhunt25 may 2011Python500.06150 
Languages
C++
118
Java
40
Ruby
22
C
17
FPC
16
Python
6
Kylix
5
Haskell
2
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 

Knight's move

Time limit = 1 second

Chess association decided to assign new phone numbers to all the members. The new numbers should be produced with a knight's move on a phone keypad. 0 and 8 are not valid leading digits. For instance, the number 340-49-27 matches the criteria.

789
456
123
 0 

Create a program that computes the number of different phone numbers with a length N.

Input Integer N ( 1 ≤ N ≤ 100 )

Output Number of valid phone numbers

Input#1
2
Output#1
16

Author:
Peculiarities of national computer science problems
2000

<PREV | Problem set | Search related messages | NEXT>


© acm.mipt DevGroup
The page was generated in 190ms

SW soft NIX
ID = 3.237.200.21